India’s top court on Monday upheld a move by Prime Minister Narendra Modi’s government to revoke the limited autonomy of Muslim-majority Kashmir, where an insurgency has raged for decades.

The 2019 declaration was “a culmination of the process of integration and as such is a valid exercise of power”, the Supreme Court said in its verdict.

The move was accompanied by the imposition of direct rule from New Delhi, mass arrests, a total lockdown and communication blackout that ran for months as India bolstered its armed forces in the region to contain protests.

Modi’s muscular policy has been deeply controversial in Kashmir, but was widely celebrated across India, with the insurgency that claimed tens of thousands of lives over decades largely quietened.

The move was challenged by Kashmir’s pro-India political parties, the local Bar Association and individual litigants, culminating in Monday’s verdict.

The court upheld removing the region’s autonomy, but said Jammu & Kashmir should be restored to the same statehood as any other Indian state — with no separate autonomy rights — “at the earliest and as soon as possible”.

The court ordered state elections to take place by September 30, 2024.