MOSCOW — The legislature in Russia’s fourth-largest city has voted to scrap direct mayoral elections, dealing a heavy blow to the incumbent opposition mayor.

Yekaterinburg Mayor Yevgeny Roizman, elected in 2013 for five years, is a rare public official who openly opposes President Vladimir Putin and supports his archrival Alexei Navalny.

The Yekaterinburg legislature voted on Tuesday to scrap the mayoral vote, hours after several thousand rallied on a city square Monday evening protesting the plans.

The amendments say that a prospective mayor will be now elected by the Yekaterinburg City Duma.

Roizman said the move aims not only to undermine him but also to erode local governance.