US President Donald Trump has praised Saudi Arabia's leaders after the dismissal of a number of senior ministers and the detention of princes, in what the kingdom is calling an anti-corruption investigation.

The purge and detentions, which began on Saturday, are widely seen as an effort by Crown Prince Mohammed bin Salman to assert his influence within the country.

"I have great confidence in King Salman and the Crown Prince of Saudi Arabia, they know exactly what they are doing," Trump said in a post on Twitter on Monday.

"Some of those they are harshly treating have been 'milking' their country for years!"

His tweets came days after Trump urged Saudi Arabia to list the state-owned oil giant Aramco's shares in the United States.

"I want them to strongly consider the New York Stock Exchange (NYSE) or NASDAQ, or frankly anybody else located in this country," Trump during his flight to Japan's capital, Tokyo, for the start of his Asian tour.

Would very much appreciate Saudi Arabia doing their IPO of Aramco with the New York Stock Exchange. Important to the United States! — Donald J. Trump (@realDonaldTrump) November 4, 2017

Back in May, the Saudi capital of Riyadh was the first foreign destination Trump visited since taking office in January, a move seen by analysts as signalling that his administration acknowledges the kingdom as a crucial US strategic partner.

On Sunday, the White House said that Trump spoke to Saudi King Salman bin Abdulaziz Al Saud, thanking him "for military purchases" and asking him "to strongly consider" listing Aramco on a US stock exchange.

Meanwhile, Trump's son-in-law and political adviser, Jared Kushner, recently returned to the US from a trip to Saudi Arabia, where he met officials. Washington said his visit was meant to bolster Israeli-Palestinian peace efforts.

High-profile detentions

Prince Alwaleed bin Talal, a billionaire businessman who owns the investment firm Kingdom Holding, was among those held over the weekend, according to state media.

Nasser bin Aqeel al-Tayyar, a board member of Saudi Arabia's biggest travel company, was also reportedly on the list.

{articleGUID}

The senior ministers who were sacked included Prince Mitaab bin Abdullah, the head of the National Guard, and Adel Faqih, the economy minister, state media reported.

In a statement on the official Saudi news agency, SPA, King Salman alluded to the "exploitation by some of the weak souls who have put their own interests above the public interest, in order to illicitly accrue money".

Saudi authorities have also reportedly frozen bank accounts of targeted individuals and drawn up a no-fly list.

The Saudi shake-up comes just months after King Salman replaced his nephew, Mohammed bin Nayef, with his son as the kingdom's crown prince.

Mohammed bin Salman has been responsible for pushing through a number of changes both at home and abroad since he became first in line to the Saudi crown.