BEIRUT — Jordan placed a gag order Tuesday on the publication of anything involving the case of Prince Hamzah bin Hussein, a day after the former crown prince signed a statement affirming his loyalty to his half brother King Abdullah II.

The Amman public prosecutor released a statement saying the gag order extends to visual and auditory media as well as social media, banning the sharing of photos or videos relating to the case. He cited the need to “preserve the secrecy of investigations that security apparatuses are carrying out relating to his royal highness Prince Hamzah bin Hussein and others.”

The order came soon after an audio recording of the prince being told to stay silent surfaced.

Hamzah, 41, had said in an earlier video recording that he has been under house arrest since Saturday, adding that the head of the army, Maj. Gen. Youssef al-Huneiti, had visited him that day and told him to refrain from speaking or meeting with non-family members.

At least 16 others were detained the same day the prince was placed under house arrest after authorities said extensive surveillance had found them plotting to disrupt the security and stability of the kingdom in cooperation with foreign entities.

On Sunday, Deputy Prime Minister Ayman al-Safadi said officials had tracked over a long period of time the activities of those “whose goals were to strike Jordan, its stability, and promote sedition.” He refrained, however, from mentioning a coup attempt.

In an occasionally unclear recording, shared by opposition groups on social media and Arab media on Tuesday, a man who later identifies himself as the head of the army mentions to Hamzah that there has been criticism of the country’s leadership on social media. Hamzah responds by asking if this criticism came from him, which the man denied. But, he added, “people are starting to talk more than usual.”

Hamzah was then asked not to mix with people and to cease tweeting, which prompted the prince to raise his voice and call for his visitor’s car to be brought around — an apparent signal that it was time for the general to leave.

Hamzah then reminded the man that he is in a royal’s abode. “You are entering and telling me what to do, and with whom to meet, for my country, in my house? You’re threatening me?” His visitor denied that this was a threat.

The prince then criticizes the government’s shortcomings, his voice rising. “I respect you, and respect your institution,” he said, almost shouting. “But you do not say these ugly things in the house of [a royal]. Get in your car and leave.”

The man replied that this was a message from himself, the head of the army, as well as from the heads of security and intelligence. When the prince asked him to repeat his demands, the man requested Hamzah rein himself in because he said opposition forces have been capitalizing on his posts.

“Have you not seen Facebook?” the man asked. In response to Hamzah’s raised voice, he calmly said, “We are telling you, you have crossed the line.”

His tone, however, remained respectful, at times deferential. He neither mentioned nor alluded to a coup plot.

The leaked recording came a day after the prince signed a typed letter, released by the royal court, in which he pledges to stick by his family’s path. “The interests of the homeland must remain above all else, and we must all stand behind his majesty the king and his efforts to protect Jordan and its national interests,” said the typed letter.

The letter was signed in the presence and in the house of Prince Hassan, Hamzah and Abdullah’s uncle, who was tapped to mediate the conflict.

Hamzah commands a loyal following in the country, with his striking resemblance to his father the late King Hussein, and his command of Arabic, outshining that of his half brother the king. Videos of the prince are frequently widely shared when discontent bubbles in the kingdom, with some calling on him to take over.

The gag order announced Tuesday is likely to further limit conversation in a country that already limits freedom of speech. Such orders are frequently employed in Jordan, most recently last August in response to teachers’ protests.

The legal statutes cited involve defamation and limits on media reporting on ongoing cases. The statement also cited penal code 255, which is unrelated and involves legal tenders — but probably meant to cite penal code 355, which sentences anyone who shares state secrets to prison for three years.