By ABDULLAH AL-SHIHRI and AYA BATRAWY, Associated Press

RIYADH, Saudi Arabia (AP) — Saudi Arabia's King Salman on Wednesday appointed his 31-year-old son Mohammed bin Salman as crown prince, placing him first-in-line to the throne and removing the country's counterterrorism czar and a figure well-known to Washington from the line of succession.

The monarch stripped Prince Mohammed bin Nayef from his title as crown prince and from his powerful position as the country's interior minister overseeing security. The announcements were made in a series of royal decrees carried on the state-run Saudi Press Agency.

The all-but-certain takeover of the throne by Mohammed bin Salman awards near absolute powers to a prince who has ruled out dialogue with rival Iran, has moved to isolate neighboring Qatar for its support of Islamist groups and who has led a war in Yemen that has killed thousands of civilians.

The prince already oversees a vast portfolio as defense minister and is spearheading economic reforms. He has become popular among some of Saudi Arabia's majority youth for pushing reforms that have opened the deeply conservative country to entertainment and greater foreign investments as part of an effort to overhaul the economy , including plans to list a percentage of the state-run oil giant Aramco.

The young prince was little known to Saudis and outsiders before Salman became king in January 2015. He had previously been in charge of his father's royal court when Salman was the crown prince.

The Saudi monarch quickly awarded his son expansive powers and named him deputy crown prince two years ago to the surprise of many within the royal family who are more senior and more experienced than Mohammed bin Salman, also known by his initials MBS.

The appointment of such a young royal as the immediate heir to the throne essentially sets Saudi policy for decades and removes the challenge of uncertainty. Saudi Arabia's stock market was up by more than 3.5 percent in mid-day trading.

"He could be there for 50 years," said Kristian Coates Ulrichsen, a research fellow at the James A. Baker III Institute for Public Policy at Rice University. "If you look at it positively, it is basically setting Saudi Arabia's course into the 21st century."

Another young prince also ascended to power on Wednesday. Prince Abdulaziz bin Saud, 33, was named the new interior minister tasked with counterterrorism efforts and domestic security. His father is the governor of Saudi Arabia's vast Eastern Province, home to much of the country's oil wealth and most of its minority Shiites. He previously served as an adviser to the interior and defense ministries.

The new interior minister is Mohammed bin Nayef's nephew, while Mohammed bin Salman is the former crown prince's cousin. All hail from the powerful Sudairi branch of the royal family.

The royal decree issued Wednesday stated that "a majority" of senior royal members from the so-called Allegiance Council support the recasting of the line of succession. However, that vote of support appears to have been from a past gathering of the council two years ago when Mohammed bin Salman was named second-in-line to the throne, and Mohammed bin Nayef was named successor.

Saudi Arabia in Photos View All 15 Images

The Allegiance Council is a body made up of the sons and prominent grandsons of the late King Abdul-Aziz, the founder of the Saudi state. They gather in secret and vote to pick the king and crown prince from among themselves. The council does not appear to have met again before Wednesday's sudden change.

Even when there is disagreement, the royal family has long followed a tradition of speaking with one voice, particularly on issues of succession, in order to appear united in front of Saudi Arabia's many tribes and communities.

After the decrees were announced, Saudi TV aired footage of the new crown prince kissing Mohammed bin Nayef's hand and kneeling before him. Mohammed bin Nayef is heard telling him: "I will rest now, and God help you."

In celebration of the news, King Salman ordered the reinstatement of all benefits and allowances for government employees that had been curbed by austerity measures, and granted additional days off for the upcoming Eid holiday that marks the end of Ramadan.

Over the weekend, the king had issued a decree restructuring Saudi Arabia's system for prosecutions that removed Mohammed bin Nayef's oversight of criminal investigations, and instead ordered that a newly-named Office of Public Prosecution report directly to the monarch.

Mohammed bin Nayef was once a towering figure credited with crushing al-Qaida's cells in Saudi Arabia. He worked closely with Washington after the Sept. 11 attacks, helping to share intelligence to thwart more attacks. The prince had previously studied at the FBI and at Scotland Yard's antiterrorism institute.

Dubbed by Washington insiders as "the prince of counterterrorism", Mohammed bin Nayef developed a ground-breaking program that rehabilitates and counsels individuals convicted of terrorism-related crimes. The center bears his name. In 2009, he survived an assassination attempt when a man who'd completed the program approached the prince and blew himself up.

The 58-year-old prince had served in a senior security post before taking over as interior minister from his father, the late Prince Nayef, in 2011. Both cracked down hard on rights activists and crushed any signs of dissent.

Though his image remained on billboards and atop buildings throughout Saudi Arabia, Mohammed bin Nayef appeared to be slipping in profile and was not believed to have played a significant role in Saudi and Emirati-led efforts to isolate Qatar for its support of Islamist groups and its ties with Iran.

Instead, it was Mohammed bin Salman, who embarked on major overseas visits, including a trip to the White House to meet President Donald Trump in March. That visit to Washington helped lay the foundation for Trump's visit to Saudi Arabia in May, which marked the president's first overseas visit and which was promoted heavily by the kingdom as proof of its weight in the region and wider Muslim world.

Saudi-U.S. relations had cooled under the Obama administration after Washington pursued a nuclear accord with Shiite-majority Iran that the Sunni-ruled kingdom strongly opposed.

The warm ties forged between Riyadh and Washington under the Trump administration may have helped accelerate Mohammed bin Salman's ascension as crown prince.

Despite his ambitions, the prince has faced criticism for the Saudi-led war in Yemen, which he oversees as defense minister.

The war, launched more than two years ago, has failed to dislodge Iranian-allied rebels known as Houthis from the capital, Sanaa, and has had devastating effects on the impoverished country. Rights groups say Saudi forces have killed scores of civilians and have called on the U.S., as well as the U.K. and France, to halt the sale of weapons to Saudi Arabia that could be used in the war.

The U.S. already is helping the Saudis with intelligence and logistical support for the bombing campaign in Yemen, and the Trump administration has signaled it could assist with greater intelligence support to counter Iranian influence there.

The newly-minted crown prince also raised eyebrows when he ruled out any chance of dialogue with Iran. In remarks aired on Saudi TV in May, Mohammed bin Salman framed the tensions with Iran in sectarian terms, saying it is Iran's goal "to control the Islamic world" and to spread its Shiite doctrine. He also vowed to take "the battle" to Iran.

Iran and Saudi Arabia's rivalry has played out in proxy wars across the region. The conflicts have deepened Sunni-Shiite enmity between hard-liners on both sides.

___

Batrawy reported from Dubai, United Arab Emirates. Associated Press writers Jon Gambrell and Fay Abuelgasim in Dubai contributed to this report.

___

Follow Aya Batrawy on Twitter at https://twitter.com/ayaelb