Vladimir Putin’s decision on Wednesday to accept the resignation of Dmitry Medvedev was not a surprise. For some time, Medvedev’s standing within the Russian government has been inexorably sinking.

There have been embarrassing public moments. Medvedev has been spotted nodding off during Putin’s presidential addresses, not once but on several occasions.

These lapses might have been forgiven. But it is allegations of personal corruption that may have weakened Medvedev fatally, leading Putin to replace him as prime minister with a low-profile tax official, Mikhail Mishustin. In a 2017 video seen by 33 million people on YouTube, the opposition leader, Alexey Navalny, accused Medvedev of secretly owning palaces, yachts and an Italian vineyard.

Medvedev wearing Nike Air Max trainers. Photograph: Handout

Medvedev, it was claimed, used a friend to do his online shopping. Photos showing the prime minister wearing a pair of Nike trainers seemingly confirmed this. The same friend allegedly acted as frontman for Medvedev’s hidden assets. The film alleged that the prime minister embezzled $1.2bn. The investigation was compelling and funny. It included footage of the diminutive Medvedev dancing with his cronies.

Corruption is not unusual among top Kremlin officials. Medvedev calls the claims “nonsense”. Still, the allegations were enormously damaging at a time when ordinary Russians’ living standards had fallen as a result of western sanctions imposed after Putin’s 2014 annexation of Crimea. Medvedev’s own speeches denouncing stealing didn’t help.

Putin’s constitutional shake-up on Wednesday appears to signal the end of Medvedev’s career in frontline politics. Medvedev has a new job: deputy head of the security council. The changes suggest that power will remain with Putin once his fourth presidential term concludes in 2024, although for now Putin’s future role is unclear.

It is a humiliating end for Medvedev, Russia’s third president after Boris Yeltsin and Putin. When Medvedev got the job in 2008, western observers looked in vain for signs that he was a more liberal figure than Putin. After trying to reset relations with Moscow, the Obama administration concluded that any differences were stylistic only.

In 2008 the US embassy sent the State Department a joke that was doing the rounds in Moscow. Putin had Medvedev’s old job of prime minister. The question occupying Russian and foreign pundits was: which one of them was Russia’s actual ruler? There was said to be a progressive Medvedev camp inside the Kremlin. But it was unclear if Medvedev was ever in it.

Timeline Putin's hold over power in Russia Show Acting prime minister Boris Yeltsin sacks his cabinet and appoints Putin, a political neophyte who headed the main successor to the KGB, as his acting prime minister and heir apparent. Acting president Yeltsin stuns Russia and the world by using his traditional new year message to announce his resignation and hand his sweeping powers, including the nuclear suitcase, to Putin. President (first term) Putin wins a surprisingly narrow majority in his first presidential election, taking 53% of the vote and avoiding a second round run-off. President (second term) Putin consolidates his centralised control of power by cruising to a second term as president with 71% of the vote, having limited press access to his opponents and harassing their campaigns. Prime minister Putin is prevented by the constitution from running for a third term as president. The First deputy prime minister Dmitry Medvedev is elected in his stead. One of his earliest moves is to appoint Putin as prime minister, leaving little doubt that the two men plan, at the very least, to run Russia in tandem. President (third term) Amid widespread allegations of vote-rigging, Putin returns to the role of president, taking 63.6%. Medvedev becomes his prime minister. "Putin has named himself the emperor of Russia for the next 12 years," says protest leader Alexei Navalny. President (fourth term) Putin is re-elected until 2024 with 77% of the vote, amid high tensions between London and Moscow over the Salisbury nerve agent attack. Opposition activists highlight a number of cases of vote-rigging and statistical anomalies. Russia holds a yes/no referendum on various topics including a proposal to amend the constitution to allow Putin to seek another two terms in the Kremlin. The resolution passes, potentially allowing him to rule as president until 2036.

The leaked US cable said: “Medvedev sits in the driver’s seat of a new car, examines the inside, the instrument panel, and the pedals. He looks around, but the steering wheel is missing. He turns to Putin and asks: ‘Vladimir Vladimirovich, where is the steering wheel?’ Putin pulls a remote control out of his pocket and says: ‘I’ll be the one doing the driving.’”

The anecdote was cruel, but it illustrated a truth understood by ordinary Russians and the Kremlin elite on Wednesday: that during a long and largely undistinguished political career, Medvedev never managed to escape from Putin’s shadow. Another confidential US dispatch describes him as playing “Robin to Putin’s Batman”. That, too, was accurate.

By 2010, hopes that Medvedev might preside over a partial liberalisation of Russian society had vanished. His progressive-sounding speeches and attacks on “legal nihilism” failed to translate into concrete political deeds. It became clear that Putin remained Russia’s de facto leader, pulling the strings especially on a foreign policy that was still anti-western in tone.

Medvedev and Putin drinking tea in a skiing and biathlon complex at Krasnaya Polyana mountain resort in southern Russia in 2014. Photograph: Alexei Nikolsky/AP

Putin “returned” as president in 2012. Medvedev went back to his former role as obedient prime minister. The unprecedented break with the centuries-long tradition in Russia and the Soviet Union of one-man – and occasionally one-woman – rule was over. Abroad, Putin was as hawkish as ever; at home there was a fresh clampdown on civil society and anti-government street protests.

Medvedev’s political rise was almost entirely down to his association with Putin. Both men came from Soviet Leningrad. While Putin had a tough working-class childhood, Medvedev’s upbringing was more comfortable. He exhibited few subversive tendencies. He lifted weights and listened to the British rockers Deep Purple, who would later play for him in the Kremlin.

Medvedev and Putin fishing on the river Volga in Russia’s Astrakhan region in 2011. Photograph: RIA Novosti / Reuters/REUTERS

Medvedev toyed with the idea of studying linguistics but eventually plumped for law, enrolling in the autumn of 1982 at Leningrad State University. It was Medvedev’s association with Anatoly Sobchak, his professor of civil law, that propelled him instead towards a life in government.

In 1990, the ambitious Sobchak returned from Moscow – where he was a deputy – and joined Leningrad’s city council, becoming its chairman. Sobchak hired Medvedev to be his adviser – and also took on another of his former students, Putin, then an undercover KGB operative newly returned from the defunct East Germany.

Medvedev first met Putin in 1990, when Putin was head of the committee for foreign relations and Medvedev worked as its adviser. The committee met a couple of times a week in the Smolny Institute, a neo-classical building that Lenin used as his HQ during the 1917 October revolution. The two men became firm friends.

Putin, eight years older and with a Soviet world-view, was the dominant figure of the two, a dynamic that would persist for 30 years. Medvedev served as Putin’s personal lawyer, and when Putin became Russia’s prime minister in 1999, he took key St Petersburg allies to Moscow with him, including Medvedev, who got a job in the presidential administration.

Putin made him first deputy prime minister and then president. With Medvedev shuffled off, Russia can expect more Putin – until 2024 and beyond.