Kremlin critic Alexei Navalny was stopped from leaving Russia on Tuesday over an unpaid fine, a move he said was illegal and designed to prevent him from attending the finale of a legal case he filed at Europe’s top human rights court.

Navalny, Russia’s most prominent opposition figure, was trying to fly to Frankfurt en route to the European Court of Human Rights in Strasbourg where judges are due to rule on Thursday on whether his numerous detentions by police in Russia have been politically-motivated or not.

Border guards detained him as he tried to pass through passport control at Moscow’s Domodedovo airport and told him he could not leave because of a ruling by the Federal Bailiffs Service.

Russians can be barred from leaving the country if they have unpaid fines or debts.

The Federal Bailiffs Service said on Tuesday evening it had removed all restrictions on Navalny’s ability to travel abroad after he paid the fine, TASS news agency quoted the service as saying.

The bailiff service’s website earlier on Tuesday showed Navalny owed a fine of 2.165 million roubles ($31,960) imposed over a conviction for embezzlement in February, 2017 on charges he says were trumped up to thwart his political activities.

Navalny said he had checked the registry on the eve of his flight and that it contained no information about the fine since the authorities had not yet asked him to pay it.

He had not been notified of the fine’s sudden enforcement in writing as the law dictates, or given the mandatory five days to pay it, he said.

“It’s interesting - what will the authorities do next?,” Navalny wrote on his blog before the Bailiffs Service issued its comment.

“The money was sitting in my lawyer’s account so it only took half an hour to pay the fine. Does that mean I can leave the country tonight or tomorrow morning?”

The 42-year-old lawyer sought to challenge Vladimir Putin at a presidential election in March, but was barred from taking part because of the conviction he says was fabricated.

Reporting by Tom Balmforth and Andrew Osborn; additional reporting by Polina Devitt; editing by Christian Lowe and Ed Osmond