The highest court in the Philippines has ruled that former president Ferdinand Marcos will be granted a ”hero’s burial”, ending a nearly three-decade fight by those who regard him as a human rights abuser and kleptocrat.

The supreme court said it had cleared all legal obstacles and petitions filed against moving his remains to the Libingan ng mga Bayani, or Heroes’ Cemetery, in Manila.

The judges voted nine to five, rejecting six petitions. Its ruling ended a deeply emotional public argument between tens of thousands who suffered violence and oppression under his tenure and those who reminisce about the years of iron-fisted rule.

The former Philippine first lady Imelda Marcos kissing the glass case bearing her late husband Ferdinand Marcos in 2014. Photograph: Ted Aljibe/AFP/Getty Images

Marcos, who died in 1989, put the country under martial law for years, in effect giving him autocratic powers for the majority of his time in office. He closed media outlets, banned people from gathering and imposed curfews. Critics were rounded up, arrested and tortured.

The current president, Rodrigo Duterte, said earlier this year that he would move ahead as planned with the delayed burial, as Marcos was “a former soldier and former president of the Philippines”.

But thousands of protesters have since staged rallies, arguing that army guidelines disqualify soldiers guilty of moral turpitude from being buried there, although Marcos was never found liable in a criminal case.

Marcos and his family fled to the US in 1986 after millions took to the streets in a “People Power” revolution. They accused him of vast rights abuses and stealing $10bn (£8bn) from state coffers. He died three years later in Hawaii.

But the family have since made a political comeback. Marcos Jr, 58, came second in the vice-presidential elections this year. He welcomed the ruling on Tuesday, saying it was an important step in the national healing and reconciliation process.

However, the vice-president, Leni Robredo, said the ruling would “keep the wounds of the past unhealed”.

The National Historical Commission of the Philippines also opposed the move, saying Marcos lied about the medals he received as a soldier during the second world war.