Russian president Vladimir Putin appeared to enjoy this weekend’s G20 summit, where he hobnobbed with other leaders, pronounced liberalism dead and joked around with Donald Trump, who at the same event last year abruptly cancelled their formal talks over events in Ukraine. After nearly 20 years in power, Putin may cast an approving eye over world affairs and conclude that things are, at last, turning decisively his way.

At home, Trump derides the checks and balances of democracy, attacks the free press and seeks to rule by diktat, and abroad his transactional, unilateralist approach alienates allies and squanders any remaining US moral authority. While Trump questions Nato’s relevance and claims the US is being “ripped off” by the EU, Britain is leaving a bloc whose fundamental liberal values and respect for the rule of law are now assailed by populist-nationalist leaders in Hungary and Poland.

Putin depicts Russia as a bastion of conservative Christian values standing firm against a dissolute, multicultural West where, he declared in an interview with the Financial Times, “migrants can kill, plunder and rape with impunity” and liberals “claim now that children can play five or six gender roles”. His crude and clichéd portrayal of Europe echoes the communist-era denunciations of western decadence that Putin grew up with and probably repeated as a KGB officer in East Germany, from where he saw Soviet power start to collapse into a period of “liberal” reform that brought chaos and humiliation to Russia.

Many Russians associate liberalism with the 1990s rule of Boris Yeltsin, when freedom to travel, do business and challenge the authorities was outweighed for most by the misery of “bandit capitalism”, poverty and chronic uncertainty. The decade ended with Putin taking office on a promise to restore stability and state power, which he did by demolishing the weak pillars of Russia’s fledgling democracy: political competition, independent media and civil liberties.

In the likes of Trump and Hungarian prime minister Viktor Orban, Putin sees a similar readiness to sacrifice the rule of law and individuals’ rights for greater personal and executive might, and in aligning with autocratically inclined leaders Putin seeks to weaken western alliances.

Recent events around the world confirm that democracy still has plenty of champions, from Istanbul’s triumphant opposition voters to the huge crowds at anti-government rallies in Hong Kong and Prague and the thousands of Russians who protested over the arrest of reporter Ivan Golunov on trumped-up drugs charges.

But if liberal values are not defended, then the rules they underpin will wither and Putin’s desired order will prevail: a system in which might is right and the strongest powers carve up the globe and dictate the fates of smaller nations.