BEIRUT, Lebanon — A recent wave of arrests in Saudi Arabia targeted citizens who were working at the behest of foreign powers to undermine the monarchy, a Saudi government official said on Friday.

Saudi Arabia has arrested at least 16 people, and perhaps more than 30, in recent days in a crackdown on people perceived to be critical of the policies of Crown Prince Mohammed bin Salman. The detained include prominent clerics, a journalist, a poet, at least two women and a prince, according to their friends, relatives and associates.

Critics of the arrests have speculated that the government wanted to tamp down dissenting voices in the country’s diplomatic spat with Qatar or that the Saudi monarch, King Salman, is preparing to abdicate in favor of his son, Crown Prince Mohammed.

The government official, who spoke on the condition of anonymity because of the sensitivity of the matter, said that the arrests were not aimed at consolidating Prince Mohammed’s power, as critics have claimed, but were instead part of a security plan to ensure the kingdom’s stability.