MANILA — The Philippines’ highest court ruled on Tuesday that the dictator Ferdinand E. Marcos may be granted a hero’s burial, resolving a divisive issue in a country where passions over his brutal 20-year rule still run high.

A spokesman for the Supreme Court, Theodore Te, said the justices voted 9 to 5 to turn down a petition submitted by rights groups opposed to the reburial of Mr. Marcos, who died in 1989.

The decision clears the way to carry out an order by President Rodrigo Duterte to bury Mr. Marcos in the national Cemetery of Heroes in Taguig City, a part of greater Manila.

In a narrow ruling that did not touch on the crimes or merits of the Marcos government, the court decided that “there is no law that prohibits the burial,” Mr. Te said.