Photo/Illutration Thailand Prime Minister Prayuth Chan-ocha attends a no-confidence debate at the Parliament in Bangkok on July 19. (AP Photo)

BANGKOK--Thailand’s Constitutional Court ruled Wednesday that Prime Minister Prayuth Chan-ocha must suspend his active duties while the court decides whether he has overstayed his legal term in office.

It was not immediately announced who would assume his duties as acting prime minister. Under law, it would be Deputy Prime Minister Prawit Wongsuwan, who is ranked first among several deputies. He is a close political ally of Prayuth and part of the same military clique that that staged the 2014 coup that initially brought him to power.

The court’s decision was announced in a statement after the news was leaked to Thai media.

The court agreed unanimously there was reason to consider the petition arguing he has exceeded his term limit. By a vote of 5 to 4, the court members agreed to suspend Prayuth from his duties effective Wednesday until it reached a decision.

The court did not say when it would issue its decision on whether Prayuth has breached the clause in the constitution on the eight-year limit. If it rules that he did, he would lose his post right away.