Google and Meta face the threat of multi-million-dollar fines for failing to delete content that the Russian government considers illegal - but a close look at court papers reveals these are often simply posts about protests in support of jailed opposition leader Alexei Navalny.
In the summer of 2018, a Russian poet writing under the pseudonym Siberian Viking posted a caricature on his Facebook account. It showed the double-headed eagle of the Russian coat of arms, with the bird's heads replaced by faces of President Vladimir Putin and the then-prime minister, Dmitri Medvedev.
Alongside it was a short poem, alleging that the eagle was twice as greedy as others, lied twice as much and carried out surveillance with four eyes. It ended with an emotional cry: "When will Russians awaken to remove this contagion?"
The Russian government told Facebook to remove the post because of its "blatant disrespect towards the state, the constitution and the president of the Russian Federation". Facebook did not comply, and the post featured in one of more than 60 lawsuits launched against Western social media in Russia this year, resulting in fines of more than $2m.
It's not clear how many of the fines have actually been paid. But the cases highlight the difficulty of operating in a country where restrictions are placed on freedom of speech and political activity - most notably the ruling in June this year that the Anti-Corruption Foundation headed by jailed opposition leader Alexei Navalny is an "extremist" organisation, on a par with the Taliban or the Islamic State group.
According to the head of media regulator Roskomnadzor, Andrei Lipov, social media companies are obliged to find and remove "the most dangerous things", which he listed in an interview with the Kommersant newspaper as "child pornography, suicide, drugs, extremism and fake news".
But a close examination of the more than 600 posts listed in court proceedings against Google, Facebook, Instagram and Twitter reveals that just nine concern child abuse or drugs, and only 12 refer to suicide. The overwhelming majority are calls to attend pro-Navalny demonstrations.
"Neither Roskomnadzor nor the Kremlin wants to say that Russia has political censorship," says Sarkis Darbinian, a legal expert at freedom-of-speech pressure group Roskomsvoboda. Commenting on the emphasis placed on child protection in official statements, he says: "To explain to the broad masses why this struggle is necessary, they exploit the tears of a child."
Roskomnadzor, the media regulator, didn't respond to the BBC's request for comment, but President Putin's press spokesman has previously said that actions taken against social media companies are not censorship, but simply attempts to enforce Russian law.
Pressure on social media companies dates back to 2015, when a law came into force obliging them to store the personal data of Russian users on Russian territory and giving the government the power to fine them, or close them down, for not doing so. None of the Western companies have complied, which led to the closure of LinkedIn in 2016. Google, Meta and Twitter have collectively been fined more than $600,000 since the start of 2020.
It was in 2016 that requests from the Russian government to Google to remove videos from YouTube and to block certain search results began to rapidly increase. The company's transparency reports show that over the last 10 years it has received more such requests from Russia than the rest of the world combined - Google says a third of them relate to "national security".
Like the other Western companies, Google complies with some Russian requests but not with others.
Efforts to control the spread of undesirable information on social media accelerated further in early 2021, after the return of Alexei Navalny to Russia from hospital in Germany, where he had been treated for poisoning with the chemical weapon Novichok.
Navalny was immediately arrested, leading to unsanctioned protests in Moscow, St Petersburg and other cities, which supporters widely advertised on social media.
This prompted angry complaints from Roskomnadzor. The posts were quickly removed from the third most popular social network in Russia, VKontakte (or VK.com), owned at that point by oligarch Alisher Usmanov, the former Arsenal football club shareholder.
But Western social networks were less accommodating, so Roskomnadzor started taking them to court and fining them.
Its next step, in March, was to slow down traffic on Twitter, for its refusal to delete these and other posts. Pictures and videos, in particular, became slower to load.
And later in the year it persuaded Google and Apple to remove from their stores a tactical voting app, designed to help Navalny sympathisers unite behind a single candidate in local elections, thereby maximising the chance of defeating the candidate of the ruling United Russia party.
The head of Navalny's team, Ivan Zhdanov, denounced the companies for what he described as "a shameful act of political censorship".
He later tweeted part of a letter from Apple, which pointed out that prosecutors had said the app was enabling illegal "interference in elections" and that media regulator Roskomnadzor had warned the company that it was promoting an "extremist organisation".
The BBC asked to interview Apple, Google, Meta and Twitter, but Google and Twitter declined to comment, and Apple and Meta didn't respond.
Roskomnadzor claims some success in getting posts deleted, as well as the voting app.
In May it partially reversed the action taken to slow down Twitter, claiming that the company had deleted 91% of a list of 5,900 tweets. Now it's only on mobile internet devices that pictures and videos on Twitter continue to load slowly.
Tweets that Twitter deletes after being fined for refusing to do so are generally only deleted for Russian users - they nearly always remain visible to users outside the country.
One of the tweets mentioned in court documents was a quote-tweet sent in January by a young activist called Alexei, relaying information about a pro-Navalny protest planned for the following Saturday in Nizhny Novgorod - a city on the Volga River, east of Moscow.
As the city's authorities hadn't approved the demonstration, Alexei chose his words carefully, describing the location as "the place you mustn't go". He added, "Putin really doesn't want you to go there, so don't!"
But the irony wasn't enough to stop Roskomnadzor taking Twitter to court, and Twitter eventually deleted the tweet.
Now, for Russian users, this tweet has been replaced by a message in English explaining that the message "has been withheld in Russia in response to a legal demand."
Elsewhere in the world, the tweet still appears as normal.
Alexei says he hadn't been informed that his tweet was being withdrawn, and only realised when he was contacted by the BBC. He expressed surprise that the original tweet about the protest - the one he retweeted - was still visible.
By contrast Alexander, a political activist in the town of Kostroma, north-west of Moscow, did get a message when his tweet about a Navalny protest was removed. His VK.com post on the same subject also vanished, but although Facebook contacted him to say the authorities had complained about his post on that network, ultimately they didn't remove it.
Meta, the parent company of Facebook and Instagram, does delete some content, though.
In the first half of 2021, it removed 1,800 pieces of content on Facebook or Instagram, at the request of Russian authorities. In its transparency report the company categorised half of these as "items related to extremism". It didn't say how many times it had refused the government's requests.
Google's transparency report also notes that it has deleted content - either search results, or YouTube videos - following objections from the Russian authorities. However it now complies with more of these requests than in the past. Only 8% were rejected in the first half of 2021, down from 50% in the same period of 2019.
Russia has the technical means to block the operations of the social media companies, and laws that could provide a justification.
They can be legally blocked for not storing the personal data of Russian users in Russia, or for refusing to delete harmful content - and from next year it will be possible to block them for not having an office in the country. So far only Google has one (though the company describes it as a "legal entity" rather than an office).
YouTube is currently being threatened with being blocked in return for shutting down channels used by the Kremlin-funded RT news outlet in Germany.
However at the end of last year, Russia also introduced new higher penalties for failure to delete illegal content, and in court cases due to take place on 24 December both Google and Meta face a possible fine of up to 10% of their annual revenue in Russia.
"This motivates the platforms," Roskomnadzor boss Andrei Lipov told Kommersant. "We haven't yet resorted to these fines, but we will."
Meta has not disclosed its Russian revenue, but Google's last year was at least $1bn, opening the way to a possible fine of $100m in its case.
A former Roskomnadzor official, who asked not to be named, told the BBC these new fines enable the Russian authorities to hit the Western companies where it hurts. And he says he is sure they will.