Thailand's Constitutional Court ruled Friday that Prime Minister Prayut Chan-o-cha can stay on in his job, after suspending him from the post in August amid a dispute over the duration of his tenure.

With the current Constitution stipulating the premier can serve for a total of eight years, the opposition asked the court to rule on whether the former coup leader had already done so, including his time as interim prime minister of a junta government following the 2014 coup.

Prayut Chan-o-cha. (Kyodo)

In a 6-3 decision, the court ruled his term as prime minister began on April 6, 2017, when the current Constitution was promulgated. That means Prayut, who was re-elected prime minister in June 2019 following a general election held under the new charter, will be able to serve until April 2025.

Prayut posted a message on his Facebook page saying he respects the court ruling and thanked people for their support. The prime minister also vowed to spend the remainder of his tenure carrying out government projects on behalf of the Thai people.

Since the court on Aug. 24 suspended Prayut from performing his duties as premier, Deputy Prime Minister Prawit Wongsuwon has been serving as acting leader.

The main opposition Pheu Thai Party said it accepts the ruling but warned the decision could cause a deeper rift among Thais. Another opposition party, The Move Forward Party, expressed disappointment, saying the ruling showed the court is helping prolong coup plotters' rule.

The Constitutional Court was widely expected to rule in favor of the prime minister as it had previously sided with the government on key cases, including ordering the popular pro-democracy Future Forward Party to be dissolved after the opposition party had a surprisingly good result in the 2019 election.

Anti-government activists led by a student group gathered in downtown Bangkok on Friday to protest the ruling. The group and its allies are calling on people to dress in black for a week to express their opposition to the decision while pledging further action to fight what they describe as a "dictatorship."

As army chief, Prayut led the coup that toppled the civilian government in May 2014.

Related coverage:

Thailand to downgrade COVID-19 as disease from Oct. 1

FOCUS: Thai PM Prayut faces censure but eyes keeping power in 2023 election

FEATURE: Thailand betting on dramatic "boys' love" tourism boom