RIYADH, Saudi Arabia — Saudi Arabia’s king has stripped the Interior Ministry of many of its key mandates, including counter-terrorism, and transferred those powers to a newly created body overseen by the monarch, the state agency reported Friday.

The development comes after King Salman last month appointed his son, Prince Mohammed bin Salman, as crown prince, after ousting the previous second-in-line to the throne, Mohammed bin Nayef, who was also the interior minister.

The Saudi Press Agency said Salman ordered the creation of the Presidency of State Security to be under the command of the king, who also acts as prime minister.

The Interior Ministry will no longer be in charge of counter-terrorism, criminal investigation and the special forces, among other mandates — all of which have been transferred to the new body.

“Whatever concerns security of the state, including civil and military personnel, budgets, documents, and information will also be transferred to the new authority,” one of a series of royal decrees read.

SPA said the decrees are aimed at “confronting the security challenges with the utmost degree of flexibility, readiness, and swiftness.”

Known as the kingdom’s counterterrorism czar, Mohammed bin Nayef was credited with crushing al-Qaida’s cells in Saudi Arabia in mid-2000. He also worked closely with Washington after the Sept. 11 attacks, helping to share intelligence to thwart more attacks.

His removal gave Mohammed bin Salman, also the defense minister, a firmer hold on the kingdom’s security and foreign policies.

The 31-year-old prince has been consolidating power since his father was crowned king two and half years ago. He managed to sweep aside any competition from princes who are older or more experienced.

The prince is also the architect of Saudi Arabia’s stalemated war in Yemen against Shiite rebels and has offered aggressive comments about the kingdom confronting Shiite power Iran.

The kingdom accuses Iran of meddling in its affairs by supporting its Shiite minority, which says it is being discriminated against. In recent months, violence has spiked in the kingdom’s east and rights groups decried plans by the authorities to execute 14 Shiites in protest-related violence.

On Friday, the Interior Ministry said it foiled a “major terrorist attack” in Saihat in eastern Shiite-dominant Qatif where three wanted men were shot and killed. The ministry said weapons and explosives were seized.

The men, two Saudis and a Bahraini, have been implicated in previous attacks against security forces, it said.

“Saudi Arabia will have zero tolerance for terrorist crimes of this kind,” the statement said.