Thailand’s election commission on Monday disqualified the king’s sister from running for prime minister, formally putting an end to a candidacy that had briefly upended the nation’s political landscape.

King Maha Vajiralongkorn Bodindradebayavarangkun, 66, had publicly opposed the candidacy of his elder sister, Ubolratana Rajakanya Sirivadhana Varnavadi, 67, effectively preordaining the election commission’s decision.

She was nominated on Friday by a party linked to the Shinawatras, a political family that includes two former prime ministers accused by critics of not showing sufficient respect for Thailand’s royal institutions. The two former leaders — Thaksin Shinawatra and Yingluck Shinawatra — were both convicted in absentia of corruption-linked crimes and are living in exile.

In nominating Ms. Ubolratana, the Thai Raksa Chart Party said she was “an educated and skilled person” who was the “most suitable choice.”

Though Ms. Ubolratana gave up her royal titles in 1972 when she married an American, Thailand’s strict laws against criticizing top members of the monarchy raised concerns about how the news media would cover her candidacy.

Ms. Ubolratana’s name was not on the list of 69 candidates released by the election commission on Monday. In a statement, the commission said that members of the royal family were “above politics” and thus ineligible to run for office.

The commission said it had based its decision on King Vajiralongkorn’s comments in a statement late on Friday, in which he called his sister’s candidacy “improper and highly inappropriate.”

“Involvement of a high-ranking member of the royal family in politics, in any way, is against the nation’s traditions, customs and culture,” the king’s statement said.

The Thai Raksa Chart Party responded soon after by saying that it would comply with the orders. The Election Commission’s decision on Monday means that the party will not be able to field a candidate for prime minister since the filing deadline has already passed. The commission certified candidates for prime minister from 45 other parties, including some linked to the Shinawatras. Forces loyal to Mr. Thaksin have won every national election in Thailand this century.