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.”