Image copyright Alamy

Tuesday marks the 100th anniversary of a remarkable success for British intelligence: but one that involved spying on the United States and then conspiring with its senior officials to manipulate public opinion in America.

On the morning of 17 January 1917, Nigel de Grey walked into his boss's office in Room 40 of the Admiralty, home of British code-breakers.

It was obvious to Reginald "Blinker" Hall that his subordinate was excited.

"Do you want to bring America into the war?" de Grey asked.

The answer was obvious. Everyone knew that America entering World War One to fight the Germans would help break the stalemate.

"Yes, my boy. Why?" Hall answered.

"I've got something here which - well, it's a rather astonishing message which might do the trick if we could use it," de Grey said.

The previous day, the German foreign minister, Arthur Zimmermann, had sent a message to the German ambassador to Washington.

The message used a code that had been largely cracked by British code-breakers, the forerunners of those who would later work at Bletchley Park.

Image copyright The de grey family Image caption Nigel de Grey came up with the plan to use the telegram to change the course of World War One

Zimmermann had sent instructions to approach the Mexican government with what seems an extraordinary deal: if it was to join any war against America, it would be rewarded with the territories of Arizona, New Mexico and Texas.

"This may be a very big thing, possibly the biggest thing in the war. For the present, not a soul outside this room is to be told anything at all," Hall said after reading it.

Part of the problem was how the message had been obtained.

German telegraph cables passing through the English Channel had been cut at the start of the War by a British ship.

So Germany often sent its messages in code via neutral countries.

Germany had convinced President Wilson in the US that keeping channels of communication open would help end the War, and so the US agreed to pass on German diplomatic messages from Berlin to its embassy in Washington.

Media playback is unsupported on your device Media caption How a decrypted German telegram pushed the United States into World War One and prompted a wave of hostility on the US-Mexico border

The message - which would become known as the Zimmermann Telegram - had been handed, in code, to the American Embassy in Berlin at 15:00 on Tuesday 16 January.

The American ambassador had queried the content of such a long message and been reassured it related to peace proposals.

By that evening, it was passing through another European country and then London before being relayed to the State Department in Washington.

From there, it would eventually arrive at the German embassy on 19 January to be decoded and then recoded and sent on via a commercial Western Union telegraphic office to Mexico, arriving the same day.

Thanks to their interception capability process, Britain's code-breakers were reading the message two days before the intended recipients (although they initially could not read all of it).

Image copyright Alamy Image caption Germany's foreign minister, Arthur Zimmermann, proposed a Mexican attack on the United States

A coded message about attacking the US was actually passed along US diplomatic channels.

And Britain was spying on the US and its diplomatic traffic (something it would continue to do for another quarter of a century).

The cable was intelligence gold-dust and could be used to persuade America to join the War.

But how could Britain use it - when to do so would reveal both that they were breaking German codes and that they had obtained the message by spying on the very country it was hoping to become its ally?

Hall had all the copies locked in his desk while he decided what to do and asked for the rest to be decoded.

London was betting that Germany's use of unrestricted submarine warfare - attacking merchant shipping - would be enough to draw America into the War.

Image copyright Ila Desai Image caption An exhibition at Bletchley Park tells the story of the Zimmermann Telegram

When the signs were that an extra push might be needed, it was decided to deploy the Zimmermann Telegram.

Room 40 asked one of its contacts to get hold of a copy of anything sent to the German embassy in Mexico from the US. This provided another copy of the telegram.

Britain could then plausibly claim this was how it had got hold of the message and get round the problem of admitting it was spying on its friends.

Britain also had to convince the Americans that the message had not been concocted as part of a ruse to get them into the War.

Eventually, the US obtained its own copy from the Western Union telegraphic company, and De Grey then decoded it himself in front of a representative at the US embassy in London.

This meant technically all parties could claim that it had been decoded on US territory.

"Good Lord," President Wilson said when he was told of the details.

The telegram was then leaked to the American press and published to general amazement on 1 March 1917 (with credit attached to the American Secret Service rather than the British to avoid awkward questions of British manipulation).

Whatever scepticism was left was dispelled when Zimmermann himself took the odd move of confirming he had sent it. A month later, America was in the War.

Image copyright Tony Essex/Hulton Archive/Getty Images Image caption President Woodrow Wilson took the United States into World War One in April 1917

It would be too much to claim the Zimmermann Telegram single-handedly brought America into the War.

Germany's policy of unrestricted submarine warfare can take more credit for that.

But the telegram was useful for convincing the American public that it should be sending its men over to Europe to fight.

The telegram had proved the perfect justification for a change of policy and to convince some of the sceptics.

It was, many believed, the single greatest intelligence triumph for Britain in World War One.

It was also an early sign of the potential impact of intercepting communications, a lesson which the few British and American officials in on the real story were determined to learn from as they set about building their capability.

Early in World War Two, before America had formally entered the War, it would send a team of its best code-breakers on a clandestine mission to Britain to establish a relationship with their counterparts.

The Road to Bletchley Park exhibition at the former wartime site features a copy of the Zimmermann Telegram and details of its role.

Today, the two allies have GCHQ and the NSA - two vast intelligence agencies involved in interception and code-breaking.

They also have a pact which means that - on the whole - they are not supposed to spy on each other.

Find out more

The BBC World Service Witness programme recently told the story of how the British managed to intercept the telegram, and heard from some of the code-breakers involved.

Listen to the programme online or download the programme podcast.