In its ruling, the court considered that the 2019 decision, which allowed New Delhi to directly administer the Muslim-majority Jammu and Kashmir region, was "the culmination of the process of integration and therefore a legitimate exercise of power."
Modi immediately welcomed the decision.
The Hindu nationalist leader wrote on Twitter that "this historic decision is a sign of hope, a promise of a better future and a testament to our collective determination to build a stronger and more united India."
The Supreme Court also ordered elections in Jammu and Kashmir next year, stressing that they should be equated with other Indian states "as soon as possible", with voting to be held no later than September 30, 2024.
The revocation of Kashmir's limited autonomy was accompanied by the imposition of New Delhi's direct authority, the complete closure of the state and the cutting of communications for a month, as India reinforced its armed forces in the region to contain the protests.
Pro-India political parties in Kashmir, the local bar association and individuals objected to the decision, leading to the Supreme Court's ruling.
The unrest in Kashmir has eased dramatically after leaving tens of thousands dead for decades.