RIYADH (Reuters) - Saudi Arabia has detained three senior Saudi princes including Prince Ahmed bin Abdulaziz, the younger brother of King Salman, and Prince Mohammed bin Nayef, the king’s nephew, for allegedly planning a coup, sources with knowledge of the matter said.

Crown Prince Mohammed bin Salman, King Salman’s son and de facto ruler of the country, the world’s top oil exporter and a key U.S. ally, has moved to consolidate power since ousting Mohammed bin Nayef as heir to the throne in a 2017 palace coup.

Later that year, he arrested several royals and other prominent Saudis, holding them for months at Riyadh’s Ritz-Carlton hotel in an anti-corruption campaign that caused shockwaves at home and abroad.

Five sources told Reuters that Prince Ahmed and Mohammed bin Nayef were detained in the latest operation. Three of the sources, including a regional source, said Mohammed bin Nayef and his half-brother, Nawaf, were picked up at a private desert camp on Friday. Two sources said Ahmed was taken from his home.

Crown Prince Mohammed, also referred to as MbS, “accused them of conducting contacts with foreign powers, including the Americans and others, to carry out a coup d’etat,” the regional source said.

“With these arrests, MbS consolidated his full grip on power. It’s over with this purge,” the source added, indicating that no rivals remain to challenge his succession to the throne.

Another source said the princes were accused of “treason”. A third source said they had been discussing a coup with the support of powerful tribes but had not reached advanced stages.

The Saudi government media office did not respond to a request for comment on the detentions, first reported by The Wall Street Journal.

It was unclear where the princes are being held. There was no way to contact them for comment on the coup allegations.

FILE PHOTO: Saudi Crown Prince Mohammed Bin Nayef, the interior minister, attends the 34rd session of the Council of Arab Interior Ministers in Tunis,Tunisia April 5, 2017.REUTERS/Zoubeir Souissi

“They (princes) have to be treated with dignity,” the third source said, referring to their stature within the family.

The regional source and another source said King Salman had approved the move and described him as mentally and physically sound.

The 84-year-old monarch met British Foreign Secretary Dominic Raab on Thursday in Riyadh. King Salman and the crown prince attended a cabinet meeting on Tuesday.

Crown Prince Mohammed, 34, has fueled resentment among some prominent branches of the ruling family by tightening his grip on power. Some critics have questioned his ability to lead after the 2018 murder of a prominent journalist by Saudi agents and the largest-ever attack on Saudi oil infrastructure last year, sources have said.

They said royals seeking to change the line of succession view Prince Ahmed, King Salman’s only surviving full brother, as a possible choice who would have support of family members, the security apparatus, and some Western powers.

Saudi authorities have not commented on issues of succession or criticism of the crown prince’s leadership. Prince Mohammed is popular among Saudi youth and has staunch supporters within the royal family, which numbers around 10,000 members.

Several Saudis on Saturday tweeted photos of the king and his son under the hashtag “We_are_all_Salman_We_are_all-Mohammed” in a show of support.

Some critics of the crown prince, including a dissident prince in exile, posted pictures of Prince Ahmed, pledging allegiance to him.

KING SUPPORTS SON

Saudi insiders and Western diplomats say the family is unlikely to oppose the crown prince while the king is alive, saying the monarch would not turn against his favorite son, to whom he has delegated most responsibilities of rule.

The detentions serve as a reminder to the family “not to cross MbS in any way”, said Steffen Hertog at the London School of Economics. “It is unlikely to be a major, advanced plot to change the Saudi leadership, given that none of the individuals arrested have any significant access to state resources anymore.”

Prince Ahmed has kept a low profile since returning to Riyadh in October 2018 after 2-1/2 months abroad. Saudi watchers have said there is no evidence he is willing to take the throne. During that trip abroad, he appeared to criticize the Saudi leadership while responding to protesters outside a London residence chanting for the downfall of the Al Saud dynasty.

Ahmed was one of only three people on the Allegiance Council, made up of the family’s senior members, who opposed MbS becoming crown prince in 2017, sources have earlier said.

The movements of Mohammed bin Nayef, who as a senior interior ministry official had deep ties to the U.S. security and intelligence apparatus, have been restricted and monitored since then, sources have previously said.

Nawaf, in his early 30s, has a much lower profile.

The latest detentions come at a time of heightened tension with arch-rival Iran and as the crown prince implements social and economic reforms, including an initial public offering by oil giant Aramco on the domestic bourse last December. Riyadh also holds the presidency of the Group of 20 major economies.

The crown prince has been lauded for easing social restrictions in the conservative Muslim kingdom and trying to diversify the economy away from oil.

But he has come under international criticism over the Yemen war, the murder of journalist Jamal Khashoggi in the kingdom’s Istanbul consulate, and the detention of women’s rights activists seen as part of a crackdown on dissent.