Frank Ryan, an ex-IRA republican leader, had joined the International Brigade in December 1936 to support the Spanish republican government against the fascist insurrection, largely in response to General Eoin O'Duffy's brigade which had gone to fight on the Franco side, encouraged by Cardinal MacRory.  Ryan was still in Spain in March 1938 when he was captured and sentenced to death. Fortunately the sentence was not immediately carried out and when the news reached Ireland appeals were made for clemency, in the first instance by de Valera through the Papal Nuncio and Franco's agent in London, the Duke of Alba. These did not appear to have had much effect and it was over a year before the death sentence was commuted to 30 years.  Ryan "was kept in the same cell as 17 others. Every morning nine were taken out and either shot or garrotted, and their places filled by nine others"  . He never knew when his turn would come.
In October 1938, according to Cronin  Kerney succeeded in visiting Ryan in Burgos jail, 240 km north of Madrid, and was able to bring pressure to bear to obtain privileges and concessions on books, food parcels and cigarettes, as well as obtaining better treatment for Ryan from the prison staff. This visit was followed by many subsequent ones. Apart from humanitarian reasons, the frequency of these visits would have conveyed to the Spanish authorities the importance the Irish government attached to this particular prisoner. Among other things, Mrs Kerney knitted him warm woollen socks to help him get through the winter. He suffered from recurrent heart trouble and rheumatism and was exempted from daily labour  . Kerney was also able to transmit correspondence to and from his family in Ireland and was keeping in contact with Ryan's friend Gerald O'Reilly in the U.S.
As he came to know Ryan, Kerney developed an appreciation and respect for the man's character even though he disagreed with some of his political views. At Christmas 1939, Ryan sent a letter to O'Reilly in which he wrote: "That I have attained so privileged a status here is entirely due to Mr. Kerney who is an efficient representative - but an even better friend. He came for a 'short visit,' Xmas Eve, and stayed two hours with me and more with my keepers. I ate a chicken dinner; he was lucky if he got home for supper..."
On the 14th March 1940, Kerney wrote to O'Reilly regarding the efforts to obtain Ryan's release: "The only assurance I can give you is that Frank's case continues to receive my constant attention and that my efforts have the complete approval and support of the Department of External Affairs  . Frank himself is aware of all our efforts; I still hope that, sooner or later, these will be crowned with success."
In another letter to O'Reilly on the 7th May 1940 Ryan wrote: "Make everyone realise - what you already know - that Mr. K. doesn't work merely as an efficient representative of a government but also as a real friend. I'm always afraid of some hot-heads doing something to embarrass him."  .
However, in spite of all his efforts, Kerney was unable to secure his release. He had originally sought to secure the exchange of Ryan for some prisoner in the hands of the Spanish Republican forces but these efforts had to cease when the Republican Government abandoned Barcelona  . He had also hoped to bring pressure to bear by negotiating in conjunction with a trade agreement which would in any case have been to Ireland's advantage, but for some reason was prevented from doing so by the Department of External Affairs in Dublin. From the moment he presented his credentials to Franco on the 10th April 1939 he had tried to arrange to start negotiations for a trade agreement but Dublin were dragging their heels on the matter  . and by the 27th November 1939 he was still pressing for proposals to be sent to him  . He then tried to adopt another approach; he succeeded in obtaining a copy of the judgment hoping that perhaps the charges could be refuted, but this came to nothing.
By early summer 1940, Kerney was getting nowhere with his efforts to secure the release of Frank Ryan. On the 23rd April 1940 he wrote in a confidential note to the secretary of the Dept. of External Affairs, Joe Walshe, in reply to one from Walshe of the 12th which is missing from the file, that there were indications that "force me gradually to the conclusion that there is secret opposition from another country than Ireland."  . In spite of the pro-German stance of the Spanish government, he suspected that the Spaniards were nevertheless susceptible to English influence. He concluded rather bitterly referring to his proposals for a trade agreement:
" I am afraid that we must agree to differ about that suggestion of mine which strikes you as being so thoroughly bad; I think I know the Spaniards better than you do; the Americans mentioned cotton and the Spaniards gave way; the English would not sign a trade treaty without a promise of immediate release of Englishmen; forceful arguments are necessary at times, at least in Spain; Iknow my suggestion to be thoroughly good, but I defer of course to your view."  .
He had previously spoken to the Secretary of the British Embassy who had given him some information on the British trade agreement and the release of four British prisoners  .