When Sergey Shoygu became Russia’s minister of defense in 2012, Russian leader Vladimir Putin gave him some interesting advice: If you want to understand America, he said, watch “House of Cards.”

The Netflix series about a Machiavellian president of the United States, who manipulates and even murders some of his opponents while making speeches about justice and human rights, perfectly captures Putin’s worldview, says Russian journalist Mikhail Zygar.

For Putin, “House of Cards” “affirmed his belief that Western politicians are all cynical scoundrels whose words about values and human rights are pure hot air and simply a tool to attack enemies,” writes Zygar in his new book, “All the Kremlin’s Men: Inside the Court of Vladimir Putin.”

But Putin’s court is its own “House of Cards.” It’s hardly surprising that the creators of the series drew on Putin when they created the character of Viktor Petrov, the wily Russian dictator who proves a match, even for the brilliantly evil President Frank Underwood in season four.

The real-life Russian leader is himself the product of a complicated, Byzantine house of mirrors, ruled by Machiavellian oligarchs and powerful bureaucrats who influence his political moves on a daily basis.

“All decisions are indeed made by Putin, but Putin is not one person,” writes Zygar. “He (or it) is a huge collective mind. Tens, perhaps hundreds of people every day try to divine what decisions Vladimir Putin needs to make. Vladimir Putin himself spends his time divining what decisions he needs to make to stay popular — to be understood and approved by the vast entity that is the collective Vladimir Putin.”

The Russian strongman was hatched amidst political intrigue. He was the protégé of billionaire and Kremlin insider Boris Berezovsky before Berezovsky fell out of favor with the powers behind the throne.

Berezovsky was an engineer and mathematician who made his fortune with a TV station in the transition from communism to capitalism. He was also a member of former president Boris Yeltsin’s inner circle. Berezovsky met Putin when Putin was the shadowy head of the KGB in the 1990s and pulled the political levers to make him Yeltsin’s political heir.

“Vladimir Putin himself spends his time divining what decisions he needs to make to stay popular — to be understood and approved by the vast entity that is the collective Vladimir Putin.” - Mikhail Zygar

But shortly after Putin’s election in May 2000, it became clear to Berezovsky that Putin was aligning himself with more hard-core elements of the Kremlin. When Berezovsky openly criticized Putin’s anti-democratic behavior, particularly his push against press freedom and the Kremlin’s posture during the sinking of the Kursk submarine in August 2000, the new president moved to seize the oligarch’s assets in Russia.

Berezovsky went into self-imposed exile in London. After losing a major court battle with another Russian oligarch — Roman Abramovich — Berezovsky hanged himself in 2013.

Like Berezovsky, Zygar is himself a victim of Putin and his Kremlin handlers. He is the founding editor-in-chief of the independent Dozhd news channel, which came to prominence in 2011 as the only network to cover the massive protests against Putin. Dozhd was also critical of the Russian leader’s annexation of the Crimea peninsula and his incursions in Ukraine.

Dozhd soon found itself the subject of a Kremlin smear campaign and was booted from its offices in an old Moscow factory.

The coup de grâce for Dozhd came in 2014 when one of its programs asked viewers how they felt about the siege of Leningrad, which resulted in a half-million deaths during World War II. Should the Russians have capitulated to save lives, journalists asked.

Putin immediately accused the TV station of “neo-Nazi” tendencies and a lack of patriotism. Overnight, cable stations across the country dropped Dozhd, virtually shutting it down. That same year, Zygar was awarded the International Press Freedom Award by the Committee to Protect Journalists.

Abroad, Putin values strong personal relationships with foreign leaders, bonding with tough guys who are most like how he sees himself, says Zygar, noting the leader remains good pals with Italy’s Silvio Berlusconi and former German Chancellor Gerhard Schröder.

Berlusconi was the only foreign leader allowed to stay at the Kremlin, according to WikiLeaks. And Schröder never missed a chance to fly to St. Petersburg for Putin’s birthdays. “A visit from the German chancellor is the best present I can have,” gushed Putin. Schröder and his wife, Doris, adopted a child in Russia, and when Schröder retired from politics in 2005, “he practically emigrated to Russia,” writes Zygar.

Putin is a lot less enamored of Schroeder’s successor, Angela Merkel. After her election, Russia’s diplomatic relations with Germany quickly soured.

By 2007, Putin could no longer hide his irritation with “the overly principled Merkel,” writes Zygar.

At a meeting in Sochi, Putin decided to show his contempt by bringing along his black Labrador — a tactic that wouldn’t be out of place on “House of Cards.”

He knew that Merkel was absolutely terrified of dogs and wanted to make her feel as uncomfortable as possible. “They made an interesting threesome, even delivering a press conference together — the Russian, the German and the dog,” writes Zygar.

“Merkel was said to be practically semiconscious with fear, not to mention furious at being treated in such a manner.”

As Frank Underwood once said, “Of all the things I hold in high regard, rules are not one of them.”

Putin surely would agree.

Are Trump and Putin really having a bromance?: