Saudi Arabia doesn't allow direct flights between its capital, Riyadh, and Baghdad, and it doesn't permit direct trade between the two countries. The kingdom is building a fence along the closed 500-mile border.

This, too, is a legacy of the U.S. invasion of Iraq as U.S. troops complete their withdrawal: a bitter enmity between two close U.S. allies, with an underlay of sectarian animosity, that the United States cannot seem to ameliorate.

It is an irony, because the U.S. first sent troops to the region in part to protect Saudi Arabia in the wake of Saddam Hussein's 1990 invasion of Kuwait. Thirteen years later, however, when the U.S. invaded Iraq to topple Saddam, Saudi rulers were highly critical. And they have remained opposed to or offended by almost everything that has happened since.

Saudi Arabia refuses to set up an embassy in Baghdad, and while it has allowed Iraq to set up a mission in Riyadh, its officials receive Iraqi government officials only as private individuals.

The Saudis charge that Iraq has come under the sway of Saudi archrival Iran. But they themselves have also tried to affect Iraqi internal politics: they've thrown their support and funds behind Ayad Allawi, al-Maliki's main political rival, who's blocked the appointment of top security officials in the Iraqi government.

"We're trying to contain them ... it's a sectarian government," said an adviser to the Saudi government who agreed to discuss the delicate Saudi-Iraqi relations anonymously because he wasn't authorized to speak to the media.

For its part, Iraq charges that insurgents are still infiltrating from Saudi Arabia. "There are a lot clerics and religious organizations that encourage and incite people to go to Iraq and fight in a so-called jihad," Labeed Abbawi, Iraq's deputy foreign minister, told McClatchy Newspapers in Baghdad, skirting direct criticism of the Saudi government.

The enmity between Saudi Arabia and Iraq is just one of the many fissures in the Middle East that have widened in the almost nine years since the U.S. toppled Saddam. Now, the Arab Spring has exacerbated already existing sectarian tensions in the region at a time when the U.S. departure from Iraq leaves it with less capacity to act in the region to intervene if military conflict seems imminent.

The biggest fissure is the division between Sunni-led Saudi Arabia and Shiite-led Iran. The two countries have been at loggerheads for centuries, in large part over whose branch of Islam should lead the Muslim world. But the replacement of Saddam Hussein's Sunni-led regime with al-Maliki's Shiite-led government unsettled the playing field for the two countries.

The current revolts in Syria and Bahrain offer new venues for Iran and Saudi Arabia to battle for influence.

In Syria, the Saudis see the overthrow of Bashar Assad as a sectarian gain for Sunni Islam, ending the domination of the Sunni majority by Assad's Alawites, a sect related to Shiism.

For Shiite Iran, the overthrow of Assad is an "existential concern," say U.S. officials. Iran uses Syria as its conduit to Lebanon, and if cornered, Tehran might lash out, analysts said.

Iraq is in the middle, literally.

It borders not just Syria but also Saudi Arabia and Turkey, which also seeks Assad's overthrow, as well as Iran, which opposes it. Civil war in Syria could easily spill over into Iraq, just as Iraq's own sectarian violence drove hundreds of thousands of Iraqis to Syria.

In Bahrain, an island attached to Saudi Arabia by a causeway, the Sunni monarchy rules over a restive Shiite majority. When demonstrations made up largely of Shiites swept Bahrain's capital in February, the monarchy blamed Iran. When the monarchy moved to suppress the protesters, it was Saudi troops who rolled in to provide the muscle.

Al-Maliki and many other top Shiite politicians have publicly voiced sympathy for the Shiites of Bahrain, arousing fierce Saudi anger. If Bahrain's Shiites do to the ruling Sunni Khalifa family what Saudis would like to have happen to Assad, that, too, could lead to confrontation.

One well-informed observer here put the chances that Saudi Arabia and its Sunni Gulf allies could stumble into war against Iran in the next three to five years at better than 50-50. Losing its close ally, Syria, and with it, the "Shiite crescent," would back Iran into a corner, and Iran might well lash out, according to this assessment.

From an outsider's perspective, consultation between Saudi Arabia and Iraq might help avoid a conflict. But that's not likely.

Many Saudis portray the enmity in personal terms, a dispute between King Abdullah and al-Maliki. But the animosity is much more deep-seated, lying, some say, at the very core of the Iraqi state that arose after Saddam was toppled.

That state, under its 2005 constitution, is not an Arab state, but a multi-ethnic, multi-religious, multi-sect country. That fact rankles Saudi Arabia, whose tribal ties with Iraq are deep and wide.

"When we have an Iraqi government that signs off on a constitution that claims it is not Arab, it's actually completely ridiculous," said the Saudi government adviser. He added that Saudis viewed it as "insulting" that a Kurd, Jalal Talabani, is the president of "an Arab country." (Iraq's ethnic makeup is about three-quarters Arab, up to one-fifth Kurdish and about 5 percent Turkomen, Assyrian or others.)

Iraq had little choice, however. Some of its most productive oilfields lie in the Kurdish north, and had the country not declared itself multi-ethnic, the Kurds would have bolted. They'd already lived largely autonomously under the protections of a U.S. no-fly zone during the last 12 years of Saddam's rule.

The Saudi adviser said that fact is unappreciated in the kingdom. "We didn't understand it in a Kurdish context, as you can imagine," he said.

King Abdullah has been up front with American officials about his feelings for al-Maliki. In March 2009, Abdullah told John Brennan, President Barack Obama's counterterrorism adviser, that he had "no confidence whatsoever" in al-Maliki, who he said had delivered a written list of promises for reconciliation between Shiite and Sunni Muslims when he visited Riyadh in 2006 but failed to carry them out.

"I don't trust this man," Abdullah said, according to a U.S. Embassy cable disclosed by WikiLeaks. "He's an Iranian agent." Abdullah refused to receive al-Maliki in May 2007, accusing him of deepening the chasm between the two Muslim sects, or ever since.

Iraq's ambassador to Saudi Arabia explains al-Maliki's action by saying the list was just ideas for national reconciliation, while Abdullah thought he was making firm commitments. "There is a limit to what a person can do in Iraq, even if he is prime minister or supreme commander of the armed forces," said Ambassador Ghanim A. al-Jumaily. "He doesn't have unchecked powers. He has to play by rules."

But Saudi Arabia has spared no effort to weaken Iraq's new order.

In Iraq's last parliamentary elections in March 2010, Saudi Arabia contributed funds, reputedly via Turkey, to Allawi, a secular Shiite who created the Iraqiya bloc of Sunni and Shiite parties and won the popular vote by a hair. Allawi welcomed Abdullah's offer to mediate between al-Maliki and Allawi in November 2010, but al-Maliki rejected the bid, charging that Saudi Arabia was not neutral.

In May, after al-Maliki criticized the Saudi intervention in Bahrain, the Gulf Cooperation Council, a Saudi-dominated club of six Sunni monarchies in the Gulf, succeeded in winning the cancellation of an Arab League summit that was to be held in Baghdad - the first such meeting in the Iraqi capital in 20 years.

The Organization of Islamic Cooperation, located in Jeddah, Saudi Arabia, which groups 56 Islamic states, then moved its meeting of foreign ministers from Iraq, population 30 million, to tiny Djibouti, population 750,000, one of the smallest countries in the group.

"We were very much surprised that Djibouti proposed itself at the very last minute, and we were very angry that many Arab countries did not support Iraq," said Abbawi, the Iraqi deputy foreign minister.

When Iraq sought to nominate Abdul Latif Jamal Rashid, the next director general of the U.N.'s Food and Agricultural Organization in Rome, the entire Arab League agreed to support Rashid, who later served as Iraq's minister of water resources. But when it came time to vote, the Arab League didn't follow through.

Abbawi, whose Iraq foreign ministry position includes overseeing relations with the Arab world, said he could not say who was responsible for the snubs, but the Saudi adviser provided his own analysis.

"There's only one power within the Arab League. It's Saudi," the adviser said. "The OIC? Of course, it's Saudi."

There are countries in and out of the Arab world "that would not like to see Iraq enjoy its rightful place in the region and international arenas," said Abbawi. "Many countries don't want to see a stable Iraq. They don't like to see Iraq enjoy the democratic norms of rule. They don't want to see Iraq become a major factor in the political affairs of the region."

Saudi Arabia also plays a key role in another Iraqi government problem: its debt.

The bigger issue for Iraq is its unresolved disputes with Kuwait, its immediate neighbor to the south, growing out of Saddam's invasion of Kuwait in 1990. Until they are resolved, relations are on hold across a range of areas, among them Iraq's ability to set up a state airline. Iraq and Kuwait might be able to resolve their differences directly, some say, but Saudi Arabia, a key Kuwaiti ally, won't directly ask the Kuwaitis to act.

Iraq owes Saudi Arabia $20 billion, which Saddam Hussein borrowed from the kingdom during the Iran-Iraq war, which lasted from 1980 to 1988 and cost millions of lives. Saudi Arabia potentially will forgive the entire debt, but not before Iraq chooses a new prime minister, the adviser to the government said.

The bigger issue for Iraq is its unresolved disputes with Kuwait, its immediate neighbor to the south, growing out of Saddam's invasion of Kuwait in 1990. Until they are resolved, relations are on hold across a range of areas, among them Iraq's ability to set up a state airline. Iraq and Kuwait might be able to resolve their differences directly, some say, but Saudi Arabia, a key Kuwaiti ally, doesn't directly ask the Kuwaitis to act.

"We don't tell the Kuwaitis, 'Don't do it,' " the adviser said. "It's just that they see what we're doing, and say, 'OK, fine, we'll do the same thing.' "

Saudi Arabia also has gone out of its way to exclude Iraq, whose main port is at the head of the Persian Gulf, from the Gulf Cooperation Council, but wants to add landlocked Jordan and Morocco, hundreds of miles away on the Atlantic.

No one wants war in a region that produces 16 percent of the world's oil. A face-off between Saudi Arabia, a U.S.-armed nation of 18 million, and Iran, with 80 million, would have no certain victor.

(EDITORS: BEGING OPTIONAL TRIM)

"No one in the Gulf is capable of waging war. It's an illusion, a tactic of last resort because they don't see what else can be done," said Judith Kipper, an expert on Saudi Arabia with the Institute of World Affairs think tank in Washington.

"However, the Gulf states could drift into war without intending it," she said. "The Iranians could do something so stupid and outrageous and unpredictable and cause a war. In a tense environment, where the main power, the United States, doesn't have relations with Iran and has to read the tea leaves, a conflict could arise by a misunderstanding."

The fall of Assad in Syria could be one trigger, analysts say. U.S. officials in the region won't comment on the record, but the loss of Syria is viewed as "existential for Iran," reporters were told in Baghdad.

Iraq would like to stay out of any clash between Saudi Arabia and Iran.

"We are trying to avoid being a part of this conflict between them," said Tahseen Shaikhli, an Iraqi government spokesman. "It is their problem, not ours. We are trying to stay away from this context. ... Unfortunately, the conflict is not on Saudi or Iranian lands."

The U.S. withdrawal from Iraq still will leave America with forces in the region - 20,000 troops in Kuwait, a major air base in Qatar, the 5th Fleet's homeport in Bahrain and close security ties to Saudi Arabia.

But the balance of power is in flux. The U.S. invasion of Iraq toppled a Sunni-led regime and brought in a Shiite-led government, many of whose leaders had friendly ties with Iranian leaders, having spent years in exile in Iran. Some Saudis fear that the U.S. wants Iraq to replace Saudi Arabia as its key oil-producing partner in the Middle East.

"The Saudis do not trust the Americans," said Jamal Khashoggi, a former Saudi newspaper editor who's now starting up an Arab-language all-news channel. "The perception of many Saudis is (that the U.S. wants) to change Iraq into the foreign policy backbone of the Americans in the Middle East, rather than Saudi Arabia."

But the Saudis have an "independent mind," he said. "You're not going to be always dancing with us. You cannot take us for granted."