MANILA (Reuters) - The Philippine Supreme Court cleared the way on Tuesday for a hero’s burial for former dictator Ferdinand Marcos, resolving an issue that has divided the nation since his death in 1989 three years after he was ousted in a “people power” revolt.

Governor Imee Marcos, daughter of late dictator Ferdinand Marcos gestures after the Supreme Court has allowed a hero's burial for the late dictator in Manila, Philippines November 8, 2016. REUTERS/Czar Dancel

Voting 9-5, the Supreme Court threw out petitions filed by leftist activists and victims of human rights abuses, ruling that President Rodrigo Duterte was within his powers to order Marcos be buried in the heroes’ cemetery, south of Manila.

“The president committed no grave abuse of discretion,” the Supreme Court said, adding that no law prohibited a hero’s burial for Marcos.

In August, Duterte, saying he was fulfilling a campaign promise, ordered the army to bury Marcos at the cemetery, prompting anti-Marcos groups to seek a ruling from the court.

Marcos’s son and namesake, Ferdinand Marcos Jr, who narrowly lost a May election for vice-president, described Tuesday’s decision as “magnanimous” and expressed hope it would “lead the nation towards healing.”

Duterte shared the sentiment.

“We hope the matter will finally be laid to rest, and that the nation finds the wherewithal to move forward and to continue forging a nation that is peaceable, just and fair to all,” his spokesman, Ernesto Abella, said in a statement.

More than a hundred Marcos supporters, carrying Philippine flags and wearing Marcos T-shirts, gathered outside the Supreme Court and cheered the decision.

But others were angry.

Slideshow ( 4 images )

“History has lost its meaning, and it’s confusing and frustrating that after so many decisions against Marcos, the Supreme Court turned itself around,” said former congressman Neri Colmenares, one of thousands of Filipinos persecuted during the era of martial law.

He said leftist groups would appeal the ruling.

Marcos ruled the Philippines for 20 years, during which time he, his family and cronies amassed an estimated $10 billion in ill-gotten wealth, a commission found. Thousands of suspected communist rebels and political foes were killed.

He was a soldier and guerrilla leader during World War Two when the former U.S. colony was occupied by Japanese forces.

Marcos died in exile in Hawaii and his family returned to the Philippines in the 1990s to became powerful local politicians representing his home province of Ilocos Norte.

His wife, Imelda, a third-term congresswoman, denies amassing wealth illegally.

His daughter Imee, the Ilocos Norte governor, said getting the hero’s burial had been a long struggle.

“This was what I promised him,” she said. “This has been my promise to him for nearly 30 years, now we’re old.”

Previous governments refused to allow the Marcos family to bury him at the cemetery, amid opposition. His embalmed body is now on display in a mausoleum in Ilocos Norte.

However, Marvic Leonen, one of the five judges who voted against the burial, said Marcos was no hero and his burial would not lead to national healing.

“He is not worthy of emulation and inspiration by those who suffer poverty as a result of the opportunity lost during his administration, by those who continue to suffer the trauma,” Leonen said.