Image copyright AFP

Anyone who wants to understand Vladimir Putin today needs to know the story of what happened to him on a dramatic night in East Germany a quarter of a century ago.

It is 5 December 1989 in Dresden, a few weeks after the Berlin Wall has fallen. East German communism is dying on its feet, people power seems irresistible.

Crowds storm the Dresden headquarters of the Stasi, the East German secret police, who suddenly seem helpless.

Then a small group of demonstrators decides to head across the road, to a large house that is the local headquarters of the Soviet secret service, the KGB.

"The guard on the gate immediately rushed back into the house," recalls one of the group, Siegfried Dannath. But shortly afterwards "an officer emerged - quite small, agitated".

"He said to our group, 'Don't try to force your way into this property. My comrades are armed, and they're authorised to use their weapons in an emergency.'"

That persuaded the group to withdraw.

But the KGB officer knew how dangerous the situation remained. He described later how he rang the headquarters of a Red Army tank unit to ask for protection.

The answer he received was a devastating, life-changing shock.

"We cannot do anything without orders from Moscow," the voice at the other end replied. "And Moscow is silent."

That phrase, "Moscow is silent" has haunted this man ever since. Defiant yet helpless as the 1989 revolution swept over him, he has now himself become "Moscow" - the President of Russia, Vladimir Putin.

Image copyright Other

"I think it's the key to understanding Putin," says his German biographer, Boris Reitschuster. "We would have another Putin and another Russia without his time in East Germany."

The experience taught him lessons he has never forgotten, gave him ideas for a model society, and shaped his ambitions for a powerful network and personal wealth.

Above all, it left him with a huge anxiety about the frailty of political elites, and how easily they can be overthrown by the people.

Putin had arrived in Dresden in the mid-1980s for his first foreign posting as a KGB agent.

The German Democratic Republic or GDR - a communist state created out of the Soviet-occupied zone of post-Nazi Germany - was a highly significant outpost of Moscow's power, up close to Western Europe, full of Soviet military and spies.

Putin had wanted to join the KGB since he was a teenager, inspired by popular Soviet stories of secret service bravado in which, he recalled later, "One man's effort could achieve what whole armies could not. One spy could decide the fate of thousands of people."

Initially, though, much of his work in Dresden was humdrum.

Among documents in the Stasi archives in Dresden is a letter from Putin asking for help from the Stasi boss with the installation of an informer's phone.

Image copyright Bstu

And there are details too of endless Soviet-East German social gatherings Putin attended, to celebrate ties between the two countries.

But if the spy work wasn't that exciting, Putin and his young family could at least enjoy the East German good life.

Putin's then wife, Ludmila, later recalled that life in the GDR was very different from life in the USSR. "The streets were clean. They would wash their windows once a week," she said in an interview published in 2000, as part of First Person, a book of interviews with Russia's new and then little-known acting president.

The Putins lived in a special block of flats with KGB and Stasi families for neighbours, though Ludmila envied the fact that: "The GDR state security people got higher salaries than our guys, judging from how our German neighbours lived. Of course we tried to economise and save up enough to buy a car."

Image copyright AFP Image caption Revisiting old haunts on a visit to Dresden in 2006

East Germany enjoyed higher living standards than the Soviet Union and a former KGB colleague, Vladimir Usoltsev, describes Putin spending hours leafing through Western mail-order catalogues, to keep up with fashions and trends.

He also enjoyed the beer - securing a special weekly supply of the local brew, Radeberger - which left him looking rather less trim than he does in the bare-chested sporty images issued by Russian presidential PR today.

East Germany differed from the USSR in another way too - it had a number of separate political parties, even though it was still firmly under communist rule, or appeared to be.

"He enjoyed very much this little paradise for him," says Boris Reitschuster. East Germany, he says, "is his model of politics especially. He rebuilt some kind of East Germany in Russia now."

But in autumn 1989 this paradise became a kind of KGB hell. On the streets of Dresden, Putin observed people power emerging in extraordinary ways.

Image copyright Bstu Image caption A heavily redacted Stasi document referring to Vladimir Putin and little else

In early October hundreds of East Germans who had claimed political asylum at the West German embassy in Prague were allowed to travel to the West in sealed trains. As they passed through Dresden, huge crowds tried to break through a security cordon to try to board the trains, and make their own escape.

Wolfgang Berghofer, Dresden's communist mayor at the time, says there was chaos as security forces began taking on almost the entire local population. Many assumed violence was inevitable.

"A Soviet tank army was stationed in our city," he says. "And its generals said to me clearly: 'If we get the order from Moscow, the tanks will roll.'"

After the Berlin Wall opened, on 9 November, the crowds became bolder everywhere - approaching the citadels of Stasi and KGB power in Dresden.

Image caption The former KGB headquarters in Dresden

Image caption The block of flats nearby, where the Putins lived

Vladimir Putin had doubtless assumed too that those senior Soviet officers - men he'd socialised with regularly - would indeed send in the tanks.

But no, Moscow under Mikhail Gorbachev "was silent". The Red Army tanks would not be used. "Nobody lifted a finger to protect us."

He and his KGB colleagues frantically burned evidence of their intelligence work.

"I personally burned a huge amount of material," Putin recalled in First Person. "We burned so much stuff that the furnace burst."

Two weeks later there was more trauma for Putin as West German Chancellor Helmut Kohl arrived in the city. He made a speech that left German reunification looking inevitable, and East Germany doomed.

Image copyright AP

Kohl praised Gorbachev, the man in Moscow who'd refused to send in the tanks, and he used patriotic language - words like Vaterland, or fatherland - that had been largely taboo in Germany since the war. Now they prompted an ecstatic response.

It's not known whether Putin was in that crowd - but as a KGB agent in Dresden he'd certainly have known all about it.

The implosion of East Germany in the following months marked a huge rupture in his and his family's life.

"We had the horrible feeling that the country that had almost become our home would no longer exist," said his wife Ludmila.

"My neighbour, who was my friend, cried for a week. It was the collapse of everything - their lives, their careers."

One of Putin's key Stasi contacts, Maj Gen Horst Boehm - the man who had helped him install that precious telephone line for an informer - was humiliated by the demonstrating crowds, and committed suicide early in 1990.

This warning about what can happen when people power becomes dominant was one Putin could now ponder on the long journey home.

"Their German friends give them a 20-year-old washing machine and with this they drive back to Leningrad," says Putin biographer and critic Masha Gessen. "There's a strong sense that he was serving his country and had nothing to show for it."

Image copyright AFP Image caption Putin worked for the mayor of St Petersburg (1990-96), then moved to Moscow and rose rapidly to the top

He also arrived back to a country that had been transformed under Mikhail Gorbachev and was itself on the verge of collapse.

"He found himself in a country that had changed in ways that he didn't understand and didn't want to accept," as Gessen puts it.

His home city, Leningrad, was now becoming St Petersburg again. What would Putin do there?

There was talk, briefly, of taxi-driving. But soon Putin realised he had acquired a much more valuable asset than a second-hand washing machine.

In Dresden he'd been part of a network of individuals who might have lost their Soviet roles, but were well placed to prosper personally and politically in the new Russia.

In the Stasi archives in Dresden a picture survives of Putin during his Dresden years. He's in a group of senior Soviet and East German military and security figures - a relatively junior figure, off to one side, but already networking among the elite.

Image copyright BTSU Image caption Vladimir Putin is standing second from the left in the front row

Prof Karen Dawisha of Miami University, author of Putin's Kleptocracy: Who Owns Russia?, says there are people he met in Dresden "who have then gone on… to be part of his inner core".

They include Sergey Chemezov, who for years headed Russia's arms export agency and now runs a state programme supporting technology, and Nikolai Tokarev head of the state pipeline company, Transneft.

And it's not only former Russian colleagues who've stayed close to Putin.

Take Matthias Warnig - a former Stasi officer, believed to have spent time in Dresden when Putin was there - who is now managing director of Nordstream, the pipeline taking gas directly from Russia to Germany across the Baltic Sea.

That pipeline symbolised what was seen, until recently, as Germany's new special relationship with Russia - though the Ukraine crisis has at the very least put that relationship on hold.

Putin-watchers believe events such as the uprising on Kiev's Maidan Square, have revived bad memories - above all, of that night in Dresden in December 1989.

"Now when you have crowds in Kiev in 2004, in Moscow in 2011 or in Kiev in 2013 and 2014, I think he remembers this time in Dresden," says Boris Reitschuster. "And all these old fears come up inside him."

Image copyright AFP

Inside him too may be a memory of how change can be shaped not only by force, or by weakness - but also by emotion. In 1989 he saw in Dresden how patriotic feeling, combined with a yearning for democracy, proved so much more powerful than communist ideology.

So when wondering what Vladimir Putin will do next, it's well worth remembering what he's lived through already.

One thing seems sure. While Vladimir Putin holds power in the Kremlin, Moscow is unlikely to be silent.

Listen to Chris Bowlby's documentary The Moment that Made Putin on BBC Radio 4 this Sunday at 13:30 and afterwards on the BBC iPlayer

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.