This piece was published in partnership with Foreign Affairs.

The plush blue curtains open, revealing a cluster of cheap eateries. The cameras focus on a young man who stumbles onto the set. He glances around, declaring the place perfect. He is planning a birthday party for a millionaire, he says, and his client will love celebrating in this “style of poverty.” The studio audience erupts with laughter.

Filming is underway for another episode of “Once Upon a Time in Russia,” a popular comedy show on TNT, one of Russia’s most watched TV stations. But the producers are not satisfied.

“No, no! We’ll have to do this again!” says Sasha, whose job is to encourage the crowd. “Clap and laugh like you mean it,” he chides the audience of around 100 people, most of them women. “We want the whole country to see how great this is, how much fun you’re having. I repeat: the whole country.”

The internet may attract more eyeballs than it used to, but Russia is still first and foremost a television nation. And it is state-run or state-connected channels that have most of the audience. The Kremlin has long used that power to manage public opinion by controlling the output of daily news programs. But as President Vladimir Putin looks set to run for a fourth term next year, his administration is taking no chances with popular perceptions by showing a new zeal for managing the message from entertainment programs as well.

Such control echoes Soviet times when art was sanctioned and approved by the state. And in the state-owned GlavKino studios on the outskirts of Moscow where “Once Upon a Time in Russia” is filmed there are many reminders of that past, with subtle updates. The famous Soviet image of a woman with a red kerchief holding a finger to her lips and warning “Do not blab!” adorns the wall of one of the studio cafes — except now it has the words “Filming in Progress” underneath.

Similarly, there are two sides to comedies like “Once Upon a Time in Russia.” The storylines poke fun at contemporary Russian life, but in a way that justifies rather than attacks the country’s widespread corruption. The Russian leadership is mocked, but only lightly.

Putin’s impersonator

In another much-loved show, “Comedy Club,” the actor Dmitry Grachev does a chillingly accurate job impersonating President Vladimir Putin himself. In one episode, he upstages a Donald Trump character, dressed up with a parody version of the U.S. president’s hairdo.

Comedy Club: Donald Trump meets Vladimir Putin

These shows give the impression of being self-critical, but are ultimately about “building support for Putin’s regime,” says Maxim Alyukov, a researcher who analyzes television output at the country’s independent Public Sociology Laboratory.

And as the economy has floundered — partly as a result of Western sanctions imposed after Russia’s annexation of Crimea — the Kremlin has seen patriotic TV programming as a way of diverting popular attention away from the “protracted crisis,” Alyukov says.

Putin himself is known to be a fan of Grachev, and has been seen on television howling with laughter at his performances. The Russian leader has even given his blessing for a film about the impersonator — revealing both for the fact such approval was needed, and that the Kremlin sees potential benefit in this kind of satire.

And such shows are hugely popular. “Once Upon a Time in Russia” is watched by 1 in every 15 television viewers according to Russian market research firm Mediascope. And although the show’s producer, the TNT network, is nominally private, there is no disguising its ties to the Kremlin. Its ultimate owner is the media arm of the state energy giant Gazprom. TNT also makes “Comedy Club.”

Our food is better than yours, says “Made in Russia”

As Russia’s relationship with the West has worsened, producers have found a soaring audience for shows using the tensions as a storyline. In the reality TV show “Made in Russia,” now in its third season on the state-run Moscow channel 360TV, young couples ditch their European-made cars and clothes in an act of defiance against U.S. and European sanctions.

Russia responded with its own counter-sanctions, including a ban on European food imports. The move initially hurt Russian consumers, but ended up boosting the domestic market. And in this vein, the couples in “Made in Russia” — whose logo is a bar code made of strands of wheat — discover that Russian products are better quality anyway.

Russia’s 007s

And for now, it looks like Russia and the West are locked into a standoff over Ukraine and other issues. “It’s impossible to give back Crimea,” says a senior FSB officer contemptuously in “Adaptation,” another TNT hit. “Everything else is possible,” he jokes. The intelligence officer is one of the lead characters in the series, a Russian version of “The Americans,” and it has been an enormous success. The network will start filming a second season this winter.

TNT declined repeated requests for comment or interviews.

But the narrative message from these shows is clear. Russia is an emboldened country that is winning at home and abroad against the West. “An important part of Russian TV propaganda is to de-legitimize Western opponents,” says Maxim Alyukov.

No doll: Russia’s Bond Girl

Spies are also the focus of state broadcaster Channel 1’s series “Sleepers,” which premiered in October. In this Russian version of the James Bond formula, a 007 type character working for the FSB grapples with terrorists and other adversaries while always beating the CIA at the espionage game.

Though Putin is widely expected to run and win a fourth term in next year’s vote, he is finding it harder to achieve the 80 percent-plus approval ratings he had after annexing Crimea in 2014. A growing opposition movement led by anti-corruption crusader Alexei Navalny has gathered momentum, attracting tens of thousands to the streets to protest Putin’s rule.

As a result, politics are seeping into entertainment television more than at any time since the Soviet Union broke up, media watchers say. On “Spotlight: Paris Hilton,” a popular satirical talk show on Channel 1, the four male hosts have traded their usual frivolous banter on current events for chit-chat that directly reinforces the state narrative. The show, whose name never had anything to do with the eponymous American socialite, returned earlier this year after a five-year break due to popular demand.

The four sit at a table covered with newspapers and make light of various political events where Russia has deemed itself triumphant. One striking example took place in April, when comedian Yuri Stoyanov burst into folksy song in tribute to Russia’s deputy ambassador to the United Nations, after he had subjected the British envoy to a patriotic tirade.

The Russian’s outburst came after the British ambassador to the United Nations, Matthew Rycroft, had accused Russia in a security council meeting of supporting a “barbaric” Syrian government. “Look at me! Don’t you look away from me!,” Vladimir Safronkov, the Russian diplomat had screamed. “Don’t you dare insult Russia again!”

For the hosts of “Spotlight: Paris Hilton”, the incident was pure comedy. Plucking at an acoustic guitar, Stoyanov belted out the words “Look into my eyes” as the men around him hopped about and gently sang “Sa-fron-kov”.

The first year of Donald Trump’s presidency has given Russian TV’s patriotic drive a further boost. Schadenfreude has long been the Kremlin’s default reaction whenever the West — especially the U.S. — fails to live up to its idealistic rhetoric. And President Trump has provided a steady flow of chaos and controversy to exploit — whether it be neo-Nazi marches in Virginia and his polarizing response or his missile barrage on Syria, a conflict Russia considers its own turf.

“The U.S. today reminds me of the final days of the Soviet Union, and that’s dangerous,” says Maxim Zabelin, a producer at small film company Zadornoe Kino. “They are blind and don’t see how the rest of the world is changing. They only think of themselves.” His production company is working on a new film parodying U.S.-Russian relations written by the satirist Mikhail Zadornov, whose disdain for the US made him a household name in Soviet times.

In modern Russia, state TV news presenters are more familiar, and their outlets are where the Kremlin first perfected its narrative control techniques. The leaders of this genre are the evening news shows on state-owned channel Rossiya 1, featuring the middle-aged, male propagandists Dmitry Kiselyov and Vladimir Soloviev, who delve into the chosen topics of the week with braggadocio.

They are widely seen as Kremlin mouthpieces who receive their instructions from the very top, and the West is usually the main target of their acerbic attacks. (Kiselyov once said Russia could turn the U.S. into “radioactive ash.”) According to MediaScope, their viewership is huge. Kiselyov’s “News of the Week” program is watched on average by 1 in every 6 Russians.

Heroic narrative

The Russian government is as concerned with the past as the present. Films about the Soviet victory in World War II have been a staple since the 1950s. Over the past few years the Kremlin has put renewed emphasis on the war as a subject for TV shows, especially those with a heroic narrative. The ministry of culture last year ordered more funds be given to productions about Russian military history and other patriotic subjects.

The Soviet Union has been given a new gloss as well. A new Rossiya 1 series called “The Optimists” centers on a team of young Soviet diplomats in the 1960s. Created by Michael Idov, a Latvian-born American journalist and screenwriter, it portrays the USSR as glamorous and unblemished, even idyllic. Russia’s sharp-tongued foreign minister, Sergei Lavrov, was among those who praised the series, saying he hoped it would encourage young people to enter the diplomatic service.The effort put into creating the TV shows is evident: the plotline of “Adaptation” makes for easy viewing, and “The Optimists” was beautifully filmed.

How the Soviet Union could have looked in the 1960s, if “The Optimists” had been right

But half-way through “The Optimists,” the mood changes and the characters are increasingly disenchanted with the system they represent and become immersed in a well of disappointment with the Soviet regime.

Idov says he did not feel any government restriction on his work, but admits he was surprised “not to be censored.” Yet he says Rossiya 1 most likely changed the show’s scheduling after the shift in narrative to a more skeptical take on the USSR became clear. It broadcast the entire 13-part series in one week, with some episodes — each over 50 minutes in length — shown well after midnight. “They just wanted it to go by as quickly as possible.”

The writer says he is not sure why this happened, but concedes that his portrayal may either have ruffled some important feathers — or Rossiya 1’s bosses were just playing safe. Russian television has become “more demonstrably loyal to the Kremlin and fearful of criticism” in recent years, Idov says. “A lot of Russian censorship is based not on orders from above, but underlings trying to capture the mood in the air.” The Kremlin is taking no chances ahead of presidential elections due next year.

That may have been what happened when a U.S.-made TV show was altered this year — to fit official Russian tastes. In “Fargo,” the TV series loosely based on the popular 1996 Cohen Brothers movie, a Ukrainian character in the third season talks about Putin. This was removed by Russia’s Channel 1 when it broadcast a dubbed version of the series in the spring. Putin’s name was replaced simply with “a boy.” References to corruption and a comparison between Russia and North Korea were also removed when the show aired on state TV.

Paradoxically perhaps, the Russian state has traditionally been happy to have Western and especially American-made shows on the channels it controls. Russia’s default position may be criticism of the West, but it also seeks its approval. “Russia has a very confused pop culture,” says Idov, where it has ended up defining itself in the context of “its love-hate relationship with Western pop culture.” But that insecurity is showing through more clearly, with alterations such as those “Fargo” underwent becoming more common.

Even Putin himself has shown a talent for flipping things around. The Russian leader is a known fan of the Machiavellian U.S. series, “House of Cards,” reportedly telling his defense minister, Sergei Shoigu, to watch it in order to learn how Washington works, according to a book on Putin by Russian journalist Mikhail Zygar.

When Putin met Trump for the first time this year, he appeared to re-enact an encounter between Viktor Petrov and Frank Underwood, the U.S. and Russian presidents in the series. The Petrov character is clearly based on Putin and is portrayed as cunning and suave. And when the real-life U.S. president extended his hand in greeting, the Russian leader surprised him by staying still except to spread his legs and glance downwards at Trump’s hand, just as Petrov did in “House of Cards. ”

The moment went viral on social media. And just like that, Putin had turned the tables and appropriated a slice of American television to get one up on the United States.

This piece was produced with support from MeydanTV.