British intelligence has hacked into an al-Qaeda online magazine and replaced bomb-making instructions with a recipe for cupcakes.

The cyber-warfare operation was carried out by MI6 and the GCHQ signals intelligence agency to disrupt the terrorists' attempts to recruit "lone-wolf" agents using a new English-language web publication called Inspire, The Daily Telegraph understands.

The spy who pranked me.

When followers tried to download the 67-page colour magazine, instead of instructions on how to "Make a bomb in the Kitchen of your Mom" by "The AQ Chef" they were greeted with garbled computer code.

The code, which had been inserted into the original magazine by the British intelligence hackers, was actually a web page from recipes for The Best Cupcakes in America published by chat show host Ellen DeGeneres.