For years, the tiny kingdom of Qatar has wielded outsized importance in the Middle East, as both the host of a massive U.S. airbase and the owner of the powerful Al Jazeera television network.

Suddenly, it's a country besieged by its erstwhile allies, with U.S. President Donald Trump using his Twitter account on Tuesday to broadcast his support for a Saudi Arabia-led effort to isolate the Persian Gulf state.

The dispute underlines the deepening political divides in the Middle East – where wars in Syria and Yemen already pit Saudi Arabia's armies and proxy fighters against those of its chief rival, Iran – while also highlighting Mr. Trump's willingness to abruptly break with long-standing U.S. policies and even alliances.

Story continues below advertisement

Janice Stein: Qatar rift shatters myth of Gulf solidarity

Latest: UAE turns screw on Qatar, threatens sympathizers with jail

While Riyadh and its allies assert they are isolating Qatar because of its support for extremist groups around the region, analysts say the real reasons for the fallout are Qatar's refusal to cut ties with Iran, as well as a six-year-old grudge over the role Qatar and Al Jazeera played in spurring the popular revolts of the Arab Spring.

It's also seen as a move by Saudi Arabia to assert its leadership over the Gulf Co-operation Council – a six-country grouping that brings together the Arab states of the Persian Gulf region – as it continues its region-wide struggle against Iran, and a move to further isolate the Muslim Brotherhood movement that Qatar supported during the Arab Spring revolts of 2011.

The new standoff could create one more fracture in the region, perhaps even another conflict if Qatar refuses to buckle to Saudi demands that it abandon its foreign-policy course. "I wouldn't exclude anything – they [Saudi Arabia] have already invaded Yemen," said James Dorsey, a political analyst who is writing a book about Saudi Arabia. "But they would need some sort of legitimacy."

On Tuesday, Saudi Arabia's Foreign Minister Adel al-Jubeir laid out his country's conditions for ending the dispute, saying Qatar had to end its support of the Muslim Brotherhood – and its Palestinian militant offshoot, Hamas – and curb "hostile media," an apparent reference to Al Jazeera.

"We've decided to take steps to make clear that enough is enough," Mr. al-Jubeir told journalists in Paris. "Nobody wants to hurt Qatar. Qatar has to choose whether it must move in one direction or another direction."

Story continues below advertisement

Saudi Arabia was emboldened by Mr. Trump's visit last month, when he broke dramatically with precedent by making Riyadh his first foreign stop since moving into the White House, said H.A. Hellyer, a non-resident Senior Fellow at the Rafik Hariri Centre for the Middle East.

"This is a power play. Saudi has decided a particular line ought to dominate in the [Gulf Co-operation Council]," Mr. Hellyer said.

The effort to isolate Qatar began Monday when Egypt, Bahrain and the United Arab Emirates joined Saudi Arabia in severing all diplomatic and transport links with their neighbour. Qatari nationals were given two weeks to depart from Saudi Arabia, Bahrain and the UAE.

The embargo – which has since been joined by the Maldives, as well as the Saudi-backed government of Yemen – also saw airspaces closed Tuesday to the Doha-based Qatar Airlines. Al Jazeera's bureau in Riyadh was closed by the Saudi Ministry of Culture and Information.

Kuwait, which along with fellow Gulf council member Oman has remained neutral in the dispute, spent Tuesday trying to negotiate a solution to the crisis. But Mr. Trump seemed to undermine that effort by endorsing the Saudi narrative that Qatar was guilty of funding extremist groups.

Mr. Trump also claimed that Qatar's isolation was a payoff from his visit to Riyadh, where he called on an audience of 50 Arab and Muslim heads of state to confront radical Islamist groups and "drive them out of this Earth."

Story continues below advertisement

During the same trip, Mr. Trump announced a $110-billion (U.S.) deal to sell weapons to the Saudi military.

"So good to see the Saudi Arabia visit with the King and 50 countries already paying off," Mr. Trump posted Tuesday on his Twitter account. "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!"

It was a curious accusation, given that Qatar plays host to more than 11,000 American military personnel, and about 100 aircraft, at its al-Udeid airbase – which has been a key hub for U.S. operations in Afghanistan and Iraq, including missions against the Islamic State group.

The U.S. military appeared caught off guard by Mr. Trump's remarks, with a Pentagon spokesman praising Qatar at a news briefing on Tuesday.

"We continue to be grateful to the Qataris for their long-standing support for our presence and their enduring commitment to regional security," Navy Captain Jeff Davis said, adding there was no plan to alter the U.S. military presence in the country. Asked to comment on the disconnect between his remarks and Mr. Trump's, Capt. Davis said: "I can't help you with that."

Until this week, Qatar was also part of the Saudi-led coalition that has sent troops into Yemen to support the country's government against Iranian-backed rebels that seized the capital city of Sanaa in 2014.

Story continues below advertisement

Saudi Arabia is itself frequently accused of providing radical Islamist groups with financial and other support. During last year's election campaign, Mr. Trump accused the Saudi regime of having aided al-Qaeda's 2001 attack on New York and Washington.

"There is an irony in the pot blaming the kettle," Mr. Dorsey, the author, said of the Saudi accusations against Qatar.

But while Saudi Arabia was free-spending in its backing of groups that shared its Wahhabist interpretation of Sunni Islam, those groups are strictly religious in their motivation, Mr. Dorsey said. Qatar crossed a line in Saudi eyes by backing groups that sought political change in the region.

"The Saudis and the Emiratis have a feeling that they have an ally in the White House that is as viscerally opposed to Iran, and as viscerally opposed to political Islam, as they are," said Mr. Dorsey, who is also a senior fellow at the Singapore-based S. Rajaratnam School of International Studies.

While Qatar has consistently backed U.S. policies, it also pursued an independent – and very ambitious, for a country of just 300,000 citizens – foreign agenda that frequently put it at odds with its neighbours, particularly Saudi Arabia.

Qatar's royal family has long been close to the multinational Muslim Brotherhood, an Islamist organization considered a terrorist group by Saudi Arabia, Egypt and Israel, among others. (Until this week, Qatar was home to several senior members of the Palestinian militant group Hamas, which is effectively the armed wing of the Muslim Brotherhood in the Israeli-occupied West Bank and Gaza Strip. Hamas members reportedly left Qatar shortly after the Saudi-led diplomatic offensive began on Monday.)

Story continues below advertisement

Qatar's royal family also stood alone among Arab leaders in openly expressing support for the Arab Spring uprisings of 2011, and Al Jazeera – which is partly owned by the Qatari royal family – was accused of cheering on the protests as they spread from one country to the next, toppling governments in Tunisia, Egypt and Libya. Qatar spent an estimated $8-billion to bolster the short-lived government of Mohammed Morsi, after the Muslim Brotherhood candidate won Egypt's postrevolution elections.

But what initially looked to be a stroke of genius quickly turned into a foreign-policy headache as Libya and Syria fell into civil war, and the Egyptian military removed Mr. Morsi in a 2012 coup d'état. Qatar, along with Turkey, is now backing one of three rival governments in Libya – the Tripoli-based General National Congress – while the UAE and Egypt have provided military support to the internationally recognized government that controls the east of the country.

The final straw that convinced some of Qatar's neighbours to move against it were comments attributed to the emir – briefly posted May 24 on an official Qatari government website, then deleted – that said Iran "cannot be ignored and it is unwise to face up against it." (While Qatar and Iran back rival forces in Syria and Yemen, the two governments have a businesslike trading relationship, founded on their shared ownership of the world's largest natural gas field, which lies between Qatar and Iran in the Persian Gulf.)

Qatar has since claimed the comments were fake and that its website was hacked, but relations with Saudi Arabia and its allies have spiralled downward ever since. Enmity rose again in recent days when the e-mails of Yousef al-Otaiba, the influential UAE ambassador to Washington – including some sent to and from senior Trump administration officials – were hacked by a previously unheard of group and leaked to U.S. media.

The e-mails laid bare the animosity between the UAE, in particular, and Qatar. In one exchange with John Hannah, an adviser to former vice-president Dick Cheney, Mr. al-Otaiba suggests that the United States pull its military base out of Qatar. In a separate document, Al Jazeera is referred to as an "instrument of regional instability."

Analysts say Qatar's isolation, and Mr. Trump's support for it, leave Emir Tamim bin Hamad al-Thani, the country's 37-year-old leader, with two only options: He can either stage a humiliating climbdown and acquiesce to the Saudi demands – effectively handing Qatari foreign policy over to Riyadh – or he can stage a sharp turn toward Tehran.

Story continues below advertisement

"It's not simply whether or not Qatar has friends – it's whether or not it has friends that are willing to oppose Saudi," Mr. Hellyer said. After Mr. Trump's intervention, only Iran seems willing.