"Nowhere in the world do castes queue up to be branded as backward. Nowhere in the world is there a competition to become backward."
India sets aside 22.5 per cent of university places and jobs for "scheduled" tribes and castes such as the Dalits, once known as untouchables.
Under its new policy, the government was planning to lift the quota for universities to 49.5 per cent to embrace the "other backward castes" - or OBCs - who are one rung up on India's complex social ladder.
In 1990, a similar government move to increase quotas in government jobs for lower castes led to outrage, with dozens of upper-caste students burning themselves to death in protest.
On Thursday, anxious upper-caste students crowding the court let out whoops of delight at the ruling and had to be restrained by security staff.
Under the government's existing affirmative action scheme, members of India's "untouchable" caste as well as minority tribe members enjoy 22.5 per cent quotas in top state educational institutions.
In court, students opposed to the move to expand quotas argued that it would affect the quality of institutions that place a high premium on merit.
It would amount to denying equal opportunity to all as mandated by India's constitution, they argued.
The federal government - a coalition of centrist and leftist political parties- has insisted that it must remove centuries of oppression of lower castes that have left them on the margins of society.