BANGKOK — A Thai political party that nominated the sister of Thailand’s king as its candidate for prime minister was dissolved on Thursday by the constitutional court for “hostile action” against the nation’s political system and constitutional monarchy.

Under Thai law, members of the royal family are considered above politics. Ubolratana Rajakanya Sirivadhana Varnavadi, 67, the elder sister of King Maha Vajiralongkorn Bodindradebayavarangkun, was born a princess but gave up her royal titles when she married an American in 1972.

Nevertheless, within hours of Ms. Ubolratana’s nomination by the Thai Raksa Chart Party last month, King Vajiralongkorn, 66, deemed her candidacy “inappropriate,” effectively ending her brief political career.

“Involvement of a high-ranking member of the royal family in politics, in any way, is against the nation’s traditions, customs and culture and is therefore considered improper and highly inappropriate,” the king said in a royal communiqué on Feb. 8.