BANGKOK — The sister of Thailand’s king was nominated on Friday as a candidate for prime minister, but by day’s end, the political foray was rebuked by the monarch as “inappropriate” behavior that violated the nation’s constitutional monarchy, apparently ending her candidacy.

In a kingdom where the royal family is considered above the volcanic eruptions of Thai politics, the prospect of the king’s sister running for office, followed by the public airing of a disagreement between the royal siblings, upended the political landscape.

Ubolratana Rajakanya Sirivadhana Varnavadi, 67, the elder sister of King Maha Vajiralongkorn Bodindradebayavarangkun, was nominated by a party associated with the Shinawatra political family, which includes two fugitive former prime ministers who have been accused of subverting the power of Thailand’s royal institutions.

Calling Ms. Ubolratana “an educated and skilled person” who was the “most suitable choice,” Preechapol Pongpanich, the leader of the Thai Raksa Chart Party, announced her candidacy on Friday but cautioned that the choice still had to be accepted by Thailand’s election commission.

But in the highly unusual palace statement, King Vajiralongkorn, 66, made clear that he disapproved of his sister’s candidacy. The late-night statement appeared to preclude any need for the commission to try to adjudicate an unprecedented question of royalty and politics.

“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 royal statement said.

King Vajiralongkorn’s royal command effectively invalidated Ms. Ubolratana’s brief political career, analysts said.

“The withdrawal of her candidacy will cool the political temperature, because it would have renewed tensions and polarization,” said Thitinan Pongsudhirak, a political scientist at Chulalongkorn University in Bangkok.

Thailand has been under military rule since a coup in 2014 unseated forces loyal to Thaksin Shinawatra, a brash billionaire who challenged the country’s traditional power structure. The country is now led by Prime Minister Prayuth Chan-ocha, a former general and junta chief who has fashioned himself as a fierce defender of Thailand’s monarchy.

The royal communiqué on Friday departed from previous convention in one important respect. While the notion that the king, queen and heir apparent are “above politics” has been a pillar of Thailand’s many constitutions, the king’s statement broadened the definition of those who should stay away from the political realm to include other members of the royal family who are close to the monarch.

On Friday, five prominent analysts of Thai politics declined to comment about Ms. Ubolratana’s candidacy. Several political activists who on social media had initially criticized her candidacy for unnecessarily muddying an already complicated political field quickly deleted their comments.

The deputy prime minister, Wissanu Krea-ngam, told reporters on Friday that he had no comment on Ms. Ubolratana’s candidacy. “If I could answer you, I would,” he said. “But I can’t.”

Since Thailand’s absolute monarchy was abolished in 1932, immediate members of the royal family have not run for high office. The country’s political system has for decades involved a cut and thrust between powerful political forces committed to elections and a military that has at times deemed the ballot box harmful to the country. The military has staged a dozen successful coups.

On Friday afternoon, Paiboon Nititawan, the head of the military-linked party that nominated Mr. Prayuth, said that he had asked the election commission to investigate whether Ms. Ubolratana’s nomination contravened regulations that ban political parties from using the royal family for election campaigning.

But the king’s late-night statement appeared to preclude any need for the election commission to weigh in on matters of the monarchy and statecraft.

In an Instagram post on Friday afternoon, Ms. Ubolratana maintained that she was a “commoner” and that she enjoyed “no privilege over the Thai people in accordance with the Constitution.”

“I have conducted this action with sincerity and the willingness to sacrifice to have the opportunity to lead the country to prosperity,” she wrote.

Rumors about Ms. Ubolratana’s close ties with the Shinawatra family intensified last year when she was pictured with Mr. Thaksin, a former prime minister, and Yingluck Shinawatra, his sister and another former prime minister.

Both brother and sister have been convicted of corruption-linked crimes in absentia and are living in exile. A 2006 military putsch ended the tenure of Mr. Thaksin, whose political base came from Thailand’s rural poor. Every election this century has been won by forces loyal to Mr. Thaksin.

But some of those close to Mr. Thaksin characterized Ms. Ubolratana’s candidacy as a dangerous blurring of lines.

“In a democratic system, we have to make clear: What is power that comes from outside the system and what is power that comes from the people?” Anon Nampha, a lawyer critical of the junta, said in a Facebook post. “This is not a democracy.”

Late last month, Ms. Ubolratana — an actress who is still sometimes referred to as a princess despite having given up her royal titles — made a high-profile pilgrimage to nine Buddhist temples, something that politicians often do to pray for good fortune in electoral contests.

Her father, King Bhumibol Adulyadej, was the world’s longest-reigning monarch until his death in 2016. Although he had no formal political role, during his seven decades on the throne, King Bhumibol was seen as a unifying force for a nation frequently troubled by coups and deadly political violence.