Dismissing a lower court order, the Supreme Court's Appellate Division directed that 93% of government jobs should be open to candidates on merit, Attorney General A.M. Amin Uddin told Reuters.
Prime Minister Sheikh Hasina's government had scrapped the quota system in 2018, under which 56% of jobs were reserved for groups such as freedom fighters' families, women and people from underdeveloped districts. But the lower court reinstated it last month, sparking the protests and an ensuing clampdown that included an internet shutdown and a curfew with the army on the streets.
The recent clashes followed similar violent protests ahead of January's national elections by Hasina's opponents in response to what they called her authoritarian rule, and by garment workers demanding better pay amid high inflation.
"Students have clearly said they are in no way part of the violence and arson that have taken place in Bangladesh since Monday," Amin Uddin said.
"I am hoping normalcy will return after today's ruling and people with ulterior motives will stop instigating people," he added.
Internet and text message services in Bangladesh have been suspended since Thursday, as security forces cracked down on protesters who defied a ban on public gatherings.
At least four protest coordinators told BBC Bangla that they planned to continue their action until they secured the release of some detained student leaders and the restoration of internet and other cellular services.
"The judgment of the Supreme Court seems unclear to us. There is no clear-cut solution for all types of quotas," said Abdul Quader, one of the coordinators.
Soldiers have been patrolling the largely deserted streets of the capital Dhaka since the government ordered a curfew late on Friday. A tank was stationed outside the Supreme Court gates at the time of the hearing.
Local media had reported scattered clashes earlier in the day between protesters and security forces. At least 139 people have been killed so far, according to data from hospitals.
The government on Saturday extended the curfew indefinitely, according to local media. Restrictions were eased for two hours on Sunday to allow people to shop for supplies.
Tanvir Hasan, a grocer in Dhaka, said, "As curfew eased, people swarmed in like bees. We just had couple of very busy hours."
The clashes have injured thousands across the country in recent days, as police used tear gas, rubber bullets and sound grenades to disperse protesters throwing bricks and setting fire to vehicles.
Experts attribute the unrest to stagnant job growth in the private sector and high youth unemployment, making public sector jobs with regular wage hikes very attractive among the group who make up nearly a fifth of the population.
Bangladesh also faces economic difficulties and secured a $4.7 billion bailout from the International Monetary Fund in January last year after struggling to pay for energy imports, which cut into its dollar reserves and fanned inflation.
Hasina, 76, who won power for a fourth straight term in January, has been credited with turning around Bangladesh's economy and its garment industry. But critics also accuse her of authoritarianism, human rights violations, crackdowns on free speech and suppression of dissent, charges her party denies.
The Supreme Court directed the government to cut the job quotas for families of independence fighters to 5% from 30%, the attorney general said. The remaining 2% of jobs still subject to quotas are for people from so-called backward groups and the disabled, he added.
There was no immediate reaction from groups affected by reduced quotas following Sunday's verdict. The court asked protesting students to return to classes and also asked the government to issue orders on the quotas.
Many opposition leaders, activists and student protesters have been arrested in the current crackdown, said Tarique Rahman, the exiled acting chairman of the main opposition Bangladesh Nationalist Party. Police arrested Nahid Islam, a leading student coordinator, on Saturday, the protesters said.
Universities and colleges have been closed since Wednesday.
India said on Sunday that over 4,500 Indian students have returned home over the past few days. It also said 500 Nepalese students and 38 from Bhutan had arrived in the country.