Saudi Arabia’s Foreign Minister Adel al-Jubeir lays down several steps for restoration of ties with Arab allies.

Qatar 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 Arabia’s foreign minister.

Bahrain, Egypt, Saudi Arabia and the United Arab Emirates 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.

“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.

“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.”

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.

READ MORE: ‘No justification’ for cutting diplomatic ties

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 Israel “exploits these statements to carry out more violations against the Palestinian people”.

Kuwait’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.

Yemen’s internationally recognised government also cut ties with Qatar, accusing it of working with its enemies in the Iran-aligned Houthi movement. The Maldives and Libya’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 measures are unjustified and are based on claims and allegations that have no basis in fact,” the foreign ministry said in another statement.

“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.”

Jubeir also dismissed Qatar’s recent rapprochement with Iran, saying that countries that deal with Tehran “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.

“Turkey will continue and will develop our ties with Qatar, as with all our friends who have supported us 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.

READ MORE: Qatari riyal under pressure amid Gulf diplomatic rift

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

In a series of posts on Twitter 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!”