Thailand's Constitutional Court ruled on Friday that Mr Prayut Chan-o-cha may stay on as prime minister after a five-week suspension, rejecting a legal challenge mounted by the opposition that argued he has reached his term limit in power.
Here are some major events in Thai politics since a military coup in 2014 led by Mr Prayut, a former army chief:
May 22, 2014: Military led by then General Prayut stages a coup, ousting an elected government for the second time in a decade, citing the need to restore order in the face of street demonstrations against a populist government linked to telecoms tycoon Thaksin Shinawatra. Thaksin himself was ousted in a coup in 2006.
Aug 25, 2014: Mr Prayut is endorsed as prime minister by King Bhumibol Adulyadej, four days after the former was elected by his own hand-picked Parliament, paving the way for the formation of an interim government.
Oct 13, 2016: King Bhumibol dies after a 70-year reign. His son becomes King Maha Vajiralongkorn.
April 6, 2017: A military-backed Constitution is ratified after being approved in a referendum, with changes requested by King Vajiralongkorn that increased his powers, paving the way for an election.
March 24, 2019: General elections are held amid complaints of cheating and vote-buying. Mr Prayut, who was then prime minister of the military government, heads a pro-army party that wins the most votes.
Nov 20, 2019: Court disqualifies rising opposition figure Thanathorn Juangroongruangkit, leader of the Future Forward Party, from Parliament prompting thousands to rally in Bangkok.
Jan 12, 2020: More than 12,000 people join an anti-government "Run Against Dictatorship" in the biggest show of dissent since the 2014 coup. A rival group holds a run in support of Mr Prayut.
Feb 21, 2020: Future Forward Party is banned for illegally taking a loan from its billionaire leader, Thanathorn, prompting small student protests on university campuses.
March 22, 2020: Given restrictions to stop the novel coronavirus, student protests peter out but online criticism of government continues, with some also directing criticism at the king.
June 8, 2020: Small protests held to call for an investigation into the disappearance of an exiled government critic in Cambodia.
June 15, 2020: Mr Prayut warns political activists not to criticise the monarchy.
June 24, 2020: Protesters gather to mark the anniversary of the end of absolute monarchy in 1932.
July 18, 2020: About 2,500 protesters gather at Democracy Monument, one of the largest demonstrations since the coup, calling for the dissolution of Parliament and new elections.
2021: Covid-19 pandemic restrictions and the arrest of many protest leaders takes the steam out of the protest movement.
May 22, 2022: Former Yingluck Shinawatra government minister Chadchart Sittipunt wins a landslide victory in the Bangkok governor election, spooking elites.
Aug 24, 2022: Thailand's Constitutional Court suspends Mr Prayut after accepting a petition from the opposition seeking his ousting on the grounds that he has held office for his full, legally mandated term. The petition filed to Parliament by the main opposition Pheu Thai party argued that Mr Prayut's time spent as head of a military junta, after he staged a coup when he was army chief in 2014, should count towards his constitutionally stipulated eight-year term.
Sept 30, 2022: The Constitutional Court rules that Mr Prayut has not breached the constitutional term limit, a decision that will allow him to remain in office. REUTERS, AFP