MI6 spent the present-day equivalent of more than $200m bribing senior Spanish military officers, ship owners and other agents to keep Spain out of the second world war, files released today disclose.

More and more money was delivered, mainly via a Swiss bank account in New York, as Sir Samuel Hoare, Britain's ambassador in Madrid, warned London that unless it was paid, there was a real and immediate danger of Spain abandoning its neutrality and of Franco joining forces with Nazi Germany.

In June 1940, Hoare was demanding an initial $1m. "I personally urge authority be granted without delay, and that if you have doubts, the prime minister be consulted," he told the Foreign Office in London. "Yes indeed," Churchill initialled on a copy of Hoare's deciphered telegram in red ink.

One file names "Senores Jose Jorro Andreo and Rasado Silva" Torres as recipients of British funds sent, in their case, to the Bank of Portugal in Lisbon.

"It may well be that Spain's entry in the war will depend on our quick action," telegraphed Hoare in another urgent plea for MI6 cash to spend on agents. The situation was "cricial", he insisted: "I cannot spend spare time to explain the position in detail."

Hoare claimed that British money was responsible for the arrest of people plotting to persuade the Spanish dictator to join the war on Germany's side. Hoare succeeded in persuading ministers in London. A top secret message from Lord Halifax, the foreign secretary, referred to British contact with guerrillas in the event of Spain being invaded by Germany. "Please burn this letter when you have read it," he told Hoare.

British agents later made contacts in Lisbon with an unnamed Spanish Republican leader and representatives of the Allianza Democratica Española. Churchill's concerns that British agents were "contacting 'Reds' with the object of stirring up a revolution" were allayed by Hugh Dalton, the minister for economic warfare, the files show.

At least $14m, some $200m in today's value, from MI6's secret vote was spent on Spanish agents during the second world war, according to the documents. At one point, British ministers persuaded the US to unblock cash for Spanish agents held in banks in New York.

Franco seemed determined throughout the war to remain neutral, though was on close terms with Germany behind the scenes.

Spaniards were not the only beneficiaries of MI6 money approved by FO ministers. "We recently put forward to our ambassador in Baghdad a suggestion for the adoption of large-scale bribery of politicians and other leading personalities in Iraq," says a file dated January 1941. The file suggests that Britain had to keep up with the Italians and Germans, placing an initial £100,000 at the embassy's disposal. The document then adds: "We have been trying by hook or by crook to dislodge the Iraqi prime minister" – a reference to the pro-Axis Rashid Ali al-Gaylani.

The spy who cross-dressed



An MI6 officer was arrested by police in Madrid during the second world war dressed "down to a brassiere, as a woman", a file disclosed today recalls. Dudley Clarke, masquerading as a Times journalist, said he told Spanish police he was a "novelist and wanted to study the reactions of men to women in the streets". He later explained that he was taking the "feminine garments to a lady in Gibraltar and thought that he would try them on "for a prank".

An anxious report to C, the head of MI6, in London reported that among the items in his suitcase was a "roll of super fine toilet paper, which particularly excited the police, who are submitting the sheets to chemical tests".

Communications intercepted by the British revealed that German officials described the case as a "first class espionage incident".

But Clarke was released, and quickly made for Gibraltar. "Please keep him under strict surveillance and despatch to Middle East by next plane," C told Gibraltar's governor. "If he shows signs of mental derangement, he should however be sent home by first ship."

He did not. Clarke "went on to have a brilliant career in deception", wrote Keith Jeffrey in his official MI6 history.

• This article was amended on 23 May 2013. In the original, the headline gave a figure of £200m, which should have been $200m.