A World War Two spy's cover was almost blown when he was found walking the streets of Madrid dressed as a woman, it was revealed in a cache of recently declassified documents.

Lieutenant Colonel Dudley Clarke was travelling to Cairo to deliver information to British General Auchinleck, commander-in-chief of the Middle East theatre, when he stopped over in Madrid and was arrested by General Franco's police dressed in a flowery dress, lipstick and a pearl necklace.

Interviewed by police, Clarke initially used his cover story that he was a war correspondent with the Times called Wrangal Craker,

He then told them he was dressed as a woman because he was "a novelist who wanted to study the reaction of men to women on the street".

According to an official at the British Consulate, reporting back to his superiors in Whitehall, Clarke was also found carrying a "another complete set of women's clothes, a war correspondent's uniform, and a roll of superfine toilet paper, which particularly excited the police."

British authorities were terrified that Clarke would be unmasked as a spy and Germany would get hold of the pictures and make them public, causing enormous embarrassment to the United Kingdom. German intelligence called it a "first class espionage incident".

"Fact that he is a British officer may be unknown to Spanish authorities and must be kept secret. Wire also if he shows signs of mental derangement," said authorities in London.

British Prime Minister Winston Churchill was kept fully abreast of the incident and ordered "if he is released, he must be sent back here."

Spanish police eventually classified it as "homosexual affair", fined Clarke, and let him go.

A British Consulate Official, interviewing Clarke after his release, "found him calm and unconcerned ... But he told a different story: he was taking the feminine garments to a lady in Gibralter and thought he would try them on for a prank. This hardly squared with the fact that the garments and shoes fitted him.

Though, as the British Embassy in Madrid reported, "Jokes have already begun about 'the editor of the Times' masquerading as a woman," subsequent to his release, Clarke went on to rise to the rank of brigadier before his death in 1974.

He was responsible for the huge deception operation, involving fake camps, airfields and traffic signals that persuaded Hitler that the allies intended to mount an invasion of mainland Europe in Calais, and that D-Day was just a bluff, causing him to divert thousands of troops from the beaches of Normandy.

He was also instrumental in the formation of the commandos and the SAS.

The declassified papers from the offices of the Cabinet Secretary and the Permanent Under-Secretary of the Foreign and Commonwealth Office revealed the details of a number of other previously top-secret Second World War and Cold War operations, including the bugging of Edward VIII's phone before his abdication, and the bribing of top Spanish generals to ensure Spain's neutrality in the war against Nazi Germany.