BAGHDAD (AP) — The U.S. team’s victory over Iran at the World Cup on Tuesday was closely watched across the Middle East, where the two nations have been engaged in a cold war for over four decades and where many blame one or both for the region’s woes.

Critics of Iran say it has fomented war and unrest across the Arab world by supporting powerful armed groups in Lebanon, Syria, Iraq, Yemen and the Palestinian territories. Supporters view it as the leader of an “axis of resistance” against what they see as U.S. imperialism, corrupt Arab rulers and Israel’s oppression of the Palestinians.

The divide is especially intense in Lebanon and Iraq, where heavily armed Iran-backed political factions vie for political influence with opponents more oriented toward the West. In those countries, many believe Iran or the U.S. are due for comeuppance — even if only on the pitch.

Others wished a plague on both their houses.

“Both are adversaries of Iraq and played a negative role in the country,” Haydar Shakar said in downtown Baghdad, where a cafe displayed the flags of both countries hanging outside. “It’s a sports tournament, and they’re both taking part in it. That’s all it is to us.”

A meme widely circulated ahead of Tuesday’s match between the U.S. and Iran jokingly referred to it as “the first time they will play outside of Lebanon.” Another Twitter user joked that whoever wins the group stage “takes Iraq.”

The Iran-backed Hezbollah was the only armed group to keep its weapons after Lebanon’s 1975-1990 civil war. It says its arms are needed to defend the country from Israel and blames Lebanon’s economic crisis in part on U.S. sanctions. Opponents decry Hezbollah as an “Iranian occupation,” while many Lebanese accuse both the U.S. and Iran of meddling in their internal affairs.

In Iraq, the 2003 U.S.-led invasion led to years of intense violence and sectarian strife, and Iran-backed political factions and militias largely filled the vacuum. While U.S. forces and Iran-backed militias found themselves on the same side against the Islamic State extremist group, they have traded fire on several occasions since its defeat.

Both Lebanon and Iraq have had to contend with years of political gridlock, with the main dividing line running between Iran’s allies and opponents.

In Yemen, the Iran-aligned Houthi militia captured the capital and much of the country’s north in 2014. The Houthis have been at war since then with an array of factions supported by Saudi Arabia and the United Arab Emirates, two U.S. allies.

In Syria’s civil war, Iran supported President Bashar Assad’s government against rebels, some supported by the West. In the Palestinian territories, it backs Hamas and Islamic Jihad, militant factions that do not recognize Israel and have carried out scores of attacks over the years.

Interviews with soccer fans in Beirut and Baghdad revealed mixed emotions about the match.

In Beirut’s southern suburbs, a center of Hezbollah support, young men draped in Iranian flags gathered in a cafe hung with a “Death to America” flag to watch the match.

“We are against America in football, politics and everything else,” Ali Nehme said. “God is with Lebanon and Iran.”

Across the city on the seafront promenade, Beirut resident Aline Noueyhed said, “Of course I’m not with Iran after all the disasters they made. Definitely, I’m with America.” She added, however, that the U.S. also was “not 100% helping us.”

The post-game reaction in the streets of Beirut after the U.S. defeated Iran 1-0, eliminating it from the tournament and advancing to the knockout round, was far more subdued than after the previous day’s win by Brazil — a fan favorite in Lebanon — over Switzerland.

In Baghdad, Ali Fadel was cheering for Iran, because “it’s a neighboring country, an Asian country.”

“There are many linkages between us and them,” he added.

In Irbil, in Iraq’s semi-autonomous Kurdish region in the north, twenty-seven-year-old Zainab Fakhri was rooting for the U.S. to beat Iran “to punish the Iranian regime that has been oppressing the women’s revolution,” referring to recent protests there.

In the Gaza Strip, a war-battered Palestinian enclave ruled by Hamas that has been under an Israeli and Egyptian blockade since 2007, most appeared to be cheering for Iran and were crestfallen when it lost.

“We are with Iran, win or lose, because it’s the only Islamic state that supports the Gaza Strip and its resistance,” said Wasim al-Hendi.

Regional politics hovered over the last matchup, at the 1998 World Cup, when Iran famously defeated the U.S. 2-1, eliminating it from the tournament. That came less than two decades after Iran’s Islamic Revolution toppled the U.S.-backed shah and protesters overran the U.S. Embassy, leading to a prolonged hostage crisis.

French riot police were on site at the stadium in Lyon that year, but they weren’t needed. The teams posed together in a group photo, and Iran’s players even brought white roses for their opponents.

In this year’s matchup, allegiances have been scrambled by the nationwide protests gripping Iran, with some Iranians openly rooting against their own team. The players declined to sing along to their national anthem ahead of their opening match, in what was seen as an expression of sympathy for the protests, but reversed course and sang ahead of their next one.

In some neighborhoods of Tehran, people chanted “Death to the dictator!” after the match, even though it was past midnight local time.

Danyel Reiche, a visiting associate professor at Georgetown University Qatar who has researched the politics of sports, said World Cup fandom is not necessarily an indicator of political affiliation, even in countries with deep divisions.

Local sports in Lebanon are “highly politicized,” with all the major basketball and soccer clubs having political and sectarian affiliations, he said. But when it comes to the World Cup — where Lebanon has never qualified to play — fans latch on to any number of teams.

That’s true across the region, where fans sporting Lionel Messi or Cristiano Ronaldo jerseys can be found from Gaza to Afghanistan.

“This is one of the few spheres where people have the liberty and freedom to choose a country that they simply like and not the country where they think there’s an obligation for them to be affiliated with it,” Reiche said.

___

Sewell reported from Beirut. Associated Press writers Fadi Tawil and Kareem Chehayeb in Beirut, Qassim Abdul-Zahra in Irbil, Iraq, Fares Akram in Gaza City, Gaza Strip, and Joseph Krauss in Ottawa contributed to this report.

___

AP World Cup coverage: https://apnews.com/hub/world-cup and https://twitter.com/AP_Sports