AFTER the Maidan revolution in 2014, Ukraine declared that it was reorienting itself towards the West and hoped one day to join the European Union. The country has since made some progress in breaking with its Soviet legacy. Yet the government still sometimes takes steps that seem more appropriate for a budding authoritarian regime than for an aspiring European democracy.

Earlier this week Petro Poroshenko, the president, announced a ban on several Russian-owned internet firms. They included VKontakte (VK) and Odnoklassniki, the two most widely used social networks in Ukraine; Mail.ru, one of the country’s most popular email services; and Yandex, a major search engine.

The government argues that the measures are a matter of national security, as Russia’s war against Ukraine drags into its third year. “The challenges of hybrid war demand adequate responses,” Mr Poroshenko wrote on his VK page, explaining his decision to close the site as an answer to “massive Russian cyberattacks across the world”. (Following the announcement of the ban, Ukraine’s presidential administration claimed that its website had come under attack by Russian hackers.) Ukrainian officials say that the social networks are used to spread Russian propaganda, and that users’ data are collected by Russia’s secret services.

The measures add to an already expansive list of Ukrainian sanctions against Russia, targeting about 1,200 individuals and more than 450 businesses. Those affected include many Russian defence firms and state-run news agencies. But the latest additions also touched seemingly innocuous companies such as 1C, which produces popular accounting software, and ABBYY, which makes dictionary and text-recognition applications.

In practice, the measures may prove counterproductive. Tens of millions of users could be affected by the social-network and email bans. Near the front lines of the fighting in eastern Ukraine, VK has become an important tool for residents to exchange information about battles and humanitarian aid. Users’ posts have provided valuable evidence for digital sleuths to prove Russia’s involvement in the war. Internet providers have said that enforcing the ban will be difficult, if not impossible. More Ukrainians may begin using Virtual Private Networks (VPN), which redirect user traffic to avoid such firewalls.

But for Mr Poroshenko, anti-Russia rhetoric may be more important than concrete results. His popularity ratings have dipped as his government’s austerity measures have pinched incomes and anti-corruption reforms have faltered. Even ineffective displays of patriotism play well to voters. Some of Mr Poroshenko’s domestic opponents see the moves as preparation for his presidential re-election campaign in 2019. “Poroshenko’s idea is to shift the focus of public discussion from the fight against corruption to his pseudo-patriotism,” wrote Sergii Leshchenko, a lawmaker critical of the president.

Whatever boost the ban may provide at home, it has unsettled Ukraine’s European allies. The head of the Council of Europe, Thorbjorn Jagland, said the move contradicted “our common understanding of freedom of expression”. Human-rights groups have condemned it as a blow to free speech. “We must not confuse censorship with defence of national security,” wrote the Kharkiv Human Rights Protection Group, a Ukrainian NGO. “There is a limit to how much Ukraine can ban if it hopes to remain a democracy.” Human Rights Watch called the move a “cynical, politically expedient attack” and an attempt to control public discourse. Many noted that the club of countries that restrict access to social media includes the aggressive neighbour that Ukraine likes to complain about. As Human Rights Watch’s head, Kenneth Roth, tweeted: “When will Ukraine learn that emulating Russia’s repression is no way to distinguish itself from Russia?”