MOSCOW (Reuters) - Russia’s Constitutional Court on Monday ruled it was legal to change the country’s constitution in a way that could allow President Vladimir Putin to remain in power until 2036, less than a week after Putin publicly backed the idea.

The court ruling came hours after thousands of Russians signed a petition urging judges to protect them from what they said was an illegal coup that would allow Putin, who has dominated the Russian political landscape for the last two decades, to subvert the constitution.

Putin, 67, unveiled an overhaul of the constitution in January which the Kremlin cast as a redistribution of power from the presidency to parliament.

He made a dramatic appearance in parliament on Tuesday to endorse a new amendment that would allow him to ignore a constitutional ban requiring him to stand down in 2024.

The move, which must still be put to a nationwide vote due next month, raises the prospect of Putin serving another two six-year terms after 2024, though the Kremlin points out that Putin has not yet said whether he will run again.

The Constitutional Court’s blessing was delivered in a 52-page ruling posted on its website on Monday.

‘ANTI-CONSTITUTIONAL COUP’

Slideshow ( 2 images )

The Kremlin said in a statement on Saturday that Putin had signed off on the constitutional changes after both houses of parliament and regional parliaments backed them with lightning speed last week.

Earlier on Monday, more than 18,000 Russians signed a petition denouncing the reform as “politically and ethically unacceptable”.

“We believe the threat of a deep constitutional crisis and an unlawful anti-constitutional coup ... is hanging over our country,” the petition, signed by prominent scientists, journalists and writers said.

The petition does not have any legal force, but its blunt language shows how strongly some Russians oppose the idea of Putin having the option to run again in 2024.

Putin remains popular with other Russians however who see him as a welcome source of stability after what some recall as the anarchic 1990s following the fall of the Soviet Union.

The Kremlin told reporters it was aware of the petition, but that it had also received numerous messages of support for the change and that it was up to Russians at a nationwide vote to decide whether to back it or not.