Donald Trump has appeared to side with Saudi Arabia in its diplomatic stand-off with Qatar, referencing his recent trip to the Saudi capital of Riyadh in which he vowed to crack down on Islamic extremism.

“During my recent trip to the Middle East I stated that there can no longer be funding of Radical Ideology. Leaders pointed to Qatar – look!” the US president tweeted on Tuesday.

Mr Trump’s post was followed up with two more a few hours later reading, “So good to see the Saudi Arabia visit with the King and 50 countries already paying off. They said they would take a hard line on funding... extremism, and all reference was pointing to Qatar. Perhaps this will be the beginning of the end to the horror of terrorism!”

Saudi Arabia, along with Gulf neighbours the UAE and Bahrain as well as Egypt, took an unexpected decision to isolate the tiny kingdom on Monday in a coordinated severing of diplomatic ties, alleging the energy-rich state funds terror groups. The row could have manifold economic and political effects for the Middle East, as well as alter the course of the region's many conflicts.

On Tuesday, supermarket shelves across the country were empty after panic buying and Doha's Hamad International Airport was eerily quiet as the first concrete effects of the rift were felt.

A statement from Monday carried on SPA, the Saudi state news agency, accused Doha of harbouring "terrorist and sectarian groups that aim to destabilise the region including the Muslim Brotherhood, Isis and Al-Qaeda," as well as alleged Iranian-backed Shia militia activity in east Saudi Arabia and Bahrain. Suggestions Qatar is abetting Shia Iran - the majority Sunni Gulf's arch-rival - are particularly sensitive. Doha has dismissed the claims as "baseless."

“The Qatari Government will take all necessary measures... to thwart attempts to influence and harm the Qatari society and economy,” a statement from the foreign ministry said.

Saudi Arabia cuts ties with Qatar over terror links

It went on to describe the crisis as being fuelled by “absolute fabrications” stemming from last month's hacking of Qatar’s state-run news agency.

The row has been caused in part by backlash over Qatar’s decision to rescue 24 members of the royal family, as well as two Saudi nationals, who were kidnapped by Shia paramilitaries while on a hunting trip in southern Iraq - a deal exclusively revealed by The Independent in April.

Doha’s agreement to pay the extraordinary $500m (£389m) ransom greatly angered its Gulf neighbours, who have long accused it of funding or otherwise supporting controversial groups and meddling in regional affairs, particularly through state-owned broadcaster al-Jazeera.

Robert Fisk: Qatar's the star – and Washington is worried Show all 3 1 /3 Robert Fisk: Qatar's the star – and Washington is worried Robert Fisk: Qatar's the star – and Washington is worried 511843.bin The Emir of Qatar Sheikh Hamad bin Khalifa Al-Thani and his wife Sheikha Moza bin Nasser Al-Missned hold the World Cup trophy AFP/GETTY IMAGES Robert Fisk: Qatar's the star – and Washington is worried 511844.bin The proposed Doha Port Stadium EPA Robert Fisk: Qatar's the star – and Washington is worried 511845.bin The Al-Jazeera newsroom in Qatar AFP/GETTY IMAGES

Iran, which Mr Trump singled out as a key source of funding and support for extremist groups during his two-day trip to Riyadh last month, is a secondary target of the decision by Saudi Arabia and its allies.

For its part, Tehran has accused the US of setting the scene for this week's growing spat during Mr Trump’s visit to Saudi Arabia.

“What is happening is the preliminary result of the sword dance,” Hamid Aboutalebi, deputy chief of staff of Iran's President Hassan Rouhani, tweeted, in a reference to a traditional ceremonial dance that took place during the welcome ceremony on the president's arrival.

Mr Trump met with leaders and envoys from 50 Muslim countries during the 20-21 May visit to Riyadh, where he gave a speech on the importance of the international community working together to stamp out extremism.

The US maintains a military base in Qatar home to some 10,000 troops.