In January 1941, General Wavell, commander of British forces in north Africa, created a unit called A Force, which was dedicated to counter-intelligence and deception. By this stage, deception was playing a major part in the war effort, following Prime Minister Winston Churchill's maxim that 'in war, truth should be accompanied by a bodyguard of lies'. In some cases there would be a concerted effort to mislead the enemy with a single convincing deception; in others, the aim would be to create confusion by suggesting a range of plausible alternatives.
Maskelyne was posted to A Force, where he was able to apply his skills to the task of concealing British forces from German aerial reconnaissance. He assembled a 14-strong group, known informally as the Magic Gang, whose members had had careers in analytical chemistry, electrical engineering and stage set construction. Maskelyne picked his team both for their skills and for qualities of initiative and imagination unconventional criteria in the military context. He himself was a hard taskmaster a dedicated perfectionist to some, an irascible egotist to others.
Applying Maskelyne's professional knowledge of cheap and lightweight construction techniques, the group produced dummy tanks made of plywood and painted canvas; Maskelyne even devised a means of faking tank tracks after the dummies had been moved into position. Similar techniques were used to disguise real tanks as innocuous lorries.
In 1941, Maskelyne was involved in an elaborate operation which diverted German bombers from the port of Alexandria by setting up a fake harbour in a nearby bay; this involved constructing dummy buildings, a dummy lighthouse and even dummy anti-aircraft batteries which fired thunderflashes. He also made it hard for German bombers to locate the Suez Canal by fitting searchlights with a revolving cone of mirrors, producing a dazzling wheel of spinning light beams nine miles across.
Maskelyne's crowning achievement came in 1942 with his involvement in Operation Bertram, prior to the battle of El Alamein, which turned the tide against the Germans in north Africa. The German forces under the legendary Erwin Rommel knew that a British counter-attack was coming; the task was to mislead them as to where and when it would take place. The Magic Gang rapidly became the nucleus of a small industry devoted to, in Maskelyne's words, 'the mass production of tricks, swindles and devices'.
The attack was to take place near the coast, at the northern end of the German line. Accordingly, at the north of the line 1,000 tanks were camouflaged as lorries, while 30 miles south 2,000 fake tanks were assembled, complete with explosive special effects. To support the illusion, a fake railway line was built; there were even fake radio broadcasts and sound effects to mimic the noise of construction.
Crucially, a fake water pipeline was built to supply the simulated armies. Its progress could easily be tracked from the air by German planes: the trick was to convince the Germans that it would not be ready, and therefore that no attack could begin, until November.
The actual attack began on the night of 23 October, catching the German forces unprepared. After 10 days of bloody attrition, the British forced the Germans into retreat; of more than 30,000 casualties, nearly two-thirds were on the German side. The role played by the element of surprise in weakening their defences was recognised afterwards by Churchill, who paid tribute in the House of Commons to the 'marvellous system of camouflage' which had contributed to the victory.
After El Alamein, the Magic Gang disbanded; there were no further wartime coups for Maskelyne. He received no decoration or honour in recognition of the part he played; official accounts of the war in north Africa made little or no mention of him. Already a published author his 1936 book White Magic told the story of his family Maskelyne told his side of the story in his 1949 memoir, Magic: Top secret.
After the war, Maskelyne resumed his stage career, but found that work as a stage magician was now becoming scarce. Embittered at the lack of official recognition, widowed and estranged from his children, Maskelyne emigrated to Kenya where he ran a driving school. He died in obscurity, aged 70.