Thailand's prime minister, who took power in a military coup five years ago, appears set to win a parliamentary vote Wednesday that will give him a second term in office.

The Democrat Party, the country's oldest, announced Tuesday that it will vote to join a coalition government led by Prayuth Chan-ocha, candidate of the military-backed Palang Pracharath party.

Prayuth's election as prime minister was virtually assured even before the Democrats' decision, because the position requires a simple majority of a joint vote by the 500-seat House of Representatives and the 250-seat Senate, whose members were appointed by the junta headed by Prayuth.

Palang Pracharath has enough allies to make Prayuth the prime minister. The Democrats' support makes it likely they will also have a majority in the lower house, which is necessary to pass legislation and approve budgets.

Uncertainty over who might hold a majority in the lower house was extended because of the previous lack of a commitment on the part of the Democrats and the similarly sized Bhumjai Thai party, who were reported to be bargaining with Palang Pracharath over what Cabinet positions they would occupy.

The pro-military coalition is opposed by the self-named "Democratic Front," which comprises anti-military parties led by the Pheu Thai Party, which won the most lower house seats in the March general election. The election was run according to laws passed under Prayuth's government that were intended to handicap Pheu Thai, which headed the government ousted by the 2014 coup.

Pheu Thai is associated with former Prime Minister Thaksin Shinawatra, who was ousted by a 2006 coup and lives in exile to avoid serving a prison term on a conflict of interest conviction he decries as politically motivated.

The alliance of seven anti-military parties announced Tuesday that it would nominate the firebrand leader of the Future Forward Party, Thanathorn Juangroongruangkit, as its candidate for prime minister.

"All seven parties have decided to nominate Thanathorn Juangroongruangkit to become the prime ministerial candidate to oppose the inheritance of power by the junta," Future Forward party spokeswoman Pannika Wanich told reporters.

The newly established Future Forward party, whose platform included strong opposition to military interference in politics, finished a strong third in the March election.

Thanathorn has faced several legal cases on various grounds against him and fellow party members since the election. Last month, the Constitutional Court accepted a case against Thanathorn that accused him of breaking election law by holding shares in a media company. The court barred him from taking his seat until it renders a verdict.

Thanathorn's supporters say the charges are politically motivated. The Election Commission was appointed by the ruling junta's allies, while the Constitutional Court has a long history of ruling in favor of the country's conservative establishment, which despises Thaksin, a billionaire populist politician.