Qatarinfo-icon must end its support for the Palestinian group Hamas and the Muslim Brotherhood before ties with other Arab Gulf states could be restored, said Saudi Arabiainfo-icon's foreign minister.

Bahraininfo-icon, Egyptinfo-icon, Saudi Arabia and the United Arab Emiratesinfo-icon severed diplomatic ties and transport links with Qatar on Monday, accusing it of supporting "extremism".

The dispute between Qatar and the Arab countries escalated after a recent hack of Qatar's state-run news agency.

"Nobody wants to hurt Qatar. It has to choose whether it must move in one direction or another direction. We took this step with great pain so that it understands that these policies are not sustainable and must change.""We want to see Qatar implement the promises it made a few years back with regard to its support of extremist groups, to its hostile media and interference in affairs of other countries," Saudi Arabia's Foreign Minister Adel Al-Jubeir told reporters in Paris.

Jubeir added that Qatar was undermining the Palestinian Authority and Egypt in its support of Hamas and the Muslim Brotherhood.

"We don't think this is good. Qatar has to stop these policies so that it can contribute to stability in the Middle East," he said.

Jubeir declined to say exactly what he wanted Qatar to do immediately, but said the measures taken by Arab states, including a sea, land and air blockade would have a considerable cost on the country.

"We believe that common sense and logic will convince Qatar to take the right steps. The decisions that were made were very strong and will have a fairly large cost on Qatar and we do not believe that Qataris want to sustain those costs," he said.

Hamas, which rules the Gaza strip, said it was "shocked" by Saudi Arabia's call on Qatar to stop supporting the group.

Jubeir's remarks "constitute a shock for our Palestinian people and the Arab and Islamic nations", according to a Hamas statement released on Wednesday.

It alleged that Israelinfo-icon "exploits these statements to carry out more violations against the Palestinian people".

Kuwaitinfo-icon's Emir, Sheikh Sabah Al Ahmad Al Jaber Al Sabah, visited Saudi Arabia on Tuesday to hold talks with the Saudi King Salman bin Abdul Aziz on ways of defusing the escalating crisis.

No details were given on the talks.

Yemeninfo-icon's internationally recognised government also cut ties with Qatar, accusing it of working with its enemies in the Iraninfo-icon-aligned Houthi movement. The Maldivesinfo-icon and Libyainfo-icon's out-of-mandate Prime Minister Abdullah al-Thinni later joined the Arab nations in saying they too would cut ties.

On Monday, Qatar expressed surprise over the "unjustified" decision to cut diplomatic ties, saying it was in "violation of its sovereignty".

"It was clear from the outset that the aim of the media campaign and the decision to cut off diplomatic and consular relations and close the borders is to pressure Qatar to abandon its national decision-making and sovereignty," the Qatari Cabinet said in a statement on Monday.

"The aim is clear, and it is to impose guardianship on the state. This by itself is a violation of its [Qatar's] sovereignty as a state.""The measures are unjustified and are based on claims and allegations that have no basis in fact," the foreign ministry said in another statement.

Jubeir also dismissed Qatar's recent rapprochement with Iran, saying that countries that deal with Tehraninfo-icon "deal with it at their own peril".

Turkish President Recep Tayyip Erdogan defended Qatar, saying he personally would have intervened if accusations that the country supports "terrorism" were true.

"Let me say at the outset that we do not think the sanctions against Qatar are good," Erdogan said in a speech in Ankara on Tuesday.

"Turkeyinfo-icon will continue and will develop our ties with Qatar, as with all our friends who have supported usinfo-icon in the most difficult moments," he added in reference to last year's failed coup.

"Efforts to isolate Qatar ... will not solve any problem," said Erdogan.

US President Donald Trump weighed on the ongoing diplomatic dispute, saying his trip to the Middle East is "already paying off".

In a series of posts on Twitterinfo-icon on Tuesday, Trump referenced Qatar when he said leaders of the Middle East have stated that they "would take a hard line on funding 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!" Trump said.

"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!"