BEIRUT, Lebanon — King Salman of Saudi Arabia promoted his 31-year-old son, Mohammed bin Salman, to be next in line to the throne on Wednesday, further empowering a young, activist leader at a time when the kingdom is struggling with low oil prices, a rivalry with Iran and conflicts across the Middle East.

The decision to remove the previous crown prince, Mohammed bin Nayef, 57, comes as some members of the royal family have chafed at the rise of the younger prince, who emerged from relative obscurity when his father, 81, ascended the throne in January 2015.

Prince Mohammed bin Salman has since accumulated vast powers in the wealthy kingdom, a crucial ally of the United States, serving as defense minister, overseeing the state oil company and working to overhaul the Saudi economy.

His supporters have praised him as hard-working and as offering a hopeful vision for the kingdom’s future, especially for its large youth population. His critics have called him inexperienced and power hungry.

The royal reordering brings to an end the career of Prince Mohammed bin Nayef, who served as interior minister and was widely respected by Saudis and their foreign allies for dismantling Al Qaeda’s networks inside the kingdom.

King Salman’s decrees on Wednesday removed Prince Mohammed both from his place in the line of succession and from his post as interior minister.

Saudi Arabia is one of the world’s few remaining absolute monarchies, where all major decisions rest with the king, a capacity that King Salman has used to empower his offspring.

Prince Mohammed bin Salman’s swift rise had led many Saudi watchers to suspect that his father wanted to make him the next king, and the young prince quickly assumed prominent roles handling some of the kingdom’s most important files.

As deputy crown prince, he spearheaded the development of a wide-ranging plan for the country’s future, called Saudi Vision 2030, which seeks to decrease the country’s dependence on oil, diversify its economy and loosen some social restrictions inside the conservative, Islamic kingdom.

As defense minister, he was also primarily responsible for the kingdom’s military intervention in Yemen, where it is leading a coalition of Arab allies in a bombing campaign aimed at pushing Houthi rebels from the capital and at restoring the government.

That campaign has made limited progress in more than two years, and human rights groups have accused the Saudis of bombing civilians, destroying Yemen’s economy and exacerbating a humanitarian crisis by imposing and air and sea blockades on the Arab world’s poorest country.

Prince Mohammed has taken a hard line on Iran, saying in a television interview last month that dialogue with the Shiite power was impossible because it sought to take control of the Islamic world.

“We are a primary target for the Iranian regime,” he said, accusing Tehran of seeking to take over Islamic holy sites in Saudi Arabia, which is home to Mecca and Medina. “We won’t wait for the battle to be in Saudi Arabia. Instead, we’ll work so that the battle is for them in Iran.”

Saudi Arabia and Iran stand on opposite sides of conflicts in Bahrain, Syria and Yemen while seeking to lessen each other’s influence across Africa, Asia and the Middle East.

During his rise, Prince Mohammed has looked for mentorship to Sheikh Mohammed bin Zayed, the crown prince of Abu Dhabi in the United Arab Emirates. The two men have recently worked in tandem to isolate Qatar, accusing it of supporting terrorism, an accusation their small neighbor denies.

Prince Mohammed has pursued a uniquely public profile for the traditionally private kingdom, giving interviews to Western news outlets and taking high-profile trips to China, Russia and the United States, where he met President Trump in March.

Saudis who work with him praise him as detail-oriented and unafraid to take risks and break conventions, a rare trait in the historically cautious kingdom.

But his father’s moves to empower him rankled other branches of their family, which found themselves sidelined at the expense of a young prince who had no significant military or business experience before 2015.

Others have criticized his plan to sell shares of the state oil giant, Saudi Aramco, a highly secretive company that has underpinned the kingdom’s economy and generated tremendous wealth for decades.

Another of the king’s sons, Prince Khalid bin Salman, was recently named ambassador to the United States.

Saudi state news outlets portrayed the move as an orderly reshuffle, saying that 31 of 34 members of a council of senior princes approved the appointment and broadcasting footage of Prince Mohammed bin Nayef pledging allegiance to his successor.

The departing prince’s profile had waned as that of his younger cousin grew. As head of the powerful Interior Ministry, which is charged with domestic security, he led a campaign against Al Qaeda in the kingdom a decade ago and had close ties to American and other Western officials.

In 2009, he was wounded when a militant detonated a bomb hidden in his rectum. People who have met with him recently said the injury’s effects have lingered, although it was unclear whether they played a role in the king’s decision to replace him.

King Salman named a young and relatively unknown prince, Abdulaziz bin Saud bin Nayef, as interior minister.