BANGKOK — The leader of the junta that seized power in Thailand five years ago, Prayuth Chan-ocha, was chosen by Parliament to be prime minister after an election marred by charges of manipulation.

Mr. Prayuth, a former general who held the title of prime minister during the years of military rule, won by a combined vote of 500 to 244 in the House of Representatives and Senate.

He defeated the opposition nominee, Thanathorn Juangroongruangkit, the leader of the pro-democracy Future Forward Party who was elected to Parliament but suspended from his seat last month by the Constitutional Court.

Mr. Prayuth, who is not a member of Parliament, chose not to address the joint session. Mr. Thanathorn was not allowed to speak before Parliament but delivered a speech outside the chamber.