BANGKOK — With the help of pro-junta lawmakers and his own handpicked Senators, junta chairman Prayuth Chan-ocha secured another term in office Wednesday night.

Gen. Prayuth, who’s been serving as prime minister since seizing power in a 2014 coup, enjoyed a majority (374 votes) in a parliamentary session held in northern Bangkok at about 11pm. Despite protests from the anti-military coalition, 250 junta-appointed Senators cast their ballots alongside the elected MPs.

Prayuth’s contender, Future Forward Party leader Thanathorn Juangroongruangkit, won 197 votes at the time of Prayuth’s victory. Wednesday night’s session concludes a race for the top government job that has been gripping national attention since Thailand went to the polls on March 24.

Voting for the prime minister began nearly 12 hours after the parliamentary session convened at about 11am. Much of the day was spent in debate, with each major party making the case for either Gen. Prayuth or Thanathorn.

There were 747 possible votes, from a combined 750 MPs and Senators. Former Abhisit Vejjajiva resigned from his MP post earlier this morning and a Future Forward MP was on sick leave, while Thanathorn was barred from casting his ballot due to a court ruling that has suspended his MP status.

Prayuth’s victory was widely expected, even among those opposing his rule. The current constitution empowers the 250 Senators, who were mostly chosen by Prayuth himself, to participate in the selection of the next prime minister. Few observers believed they would have voted for Prayuth’s rivals.

Critics of the junta have long opposed the clause, saying it interferes with the democratic process.

Returning for a second term in office, Gen. Prayuth will likely enjoy the support of the military-friendly Senate, the influential armed forces and the “20-year strategy committee” stacked with military men close to Prayuth.