BEIRUT — As Syria's soccer team stepped onto an Iranian pitch late Tuesday for an unprecedented shot at its first World Cup entry, the fans who packed cafes across the region could have been forgiven for keeping their hopes in check.

Against significant odds, the team moved up to third place in its qualifying group last week after easing past the better-resourced Qatar. An unlikely victory against favored Iran would guarantee entry to soccer's greatest tournament.

Then Syria scored the first goal.

With his eyes fixed on the television screen in his cellphone shop, Hassan Saleh was apologetic. "Sorry, it looks like you're my last customer. I need to watch this," he said.

Syria's six-year war has pitted a soccer-mad nation against itself.

The national team has been hobbled by defections, and international sanctions against the government of President Bashar al-Assad have caused funds to dry up.

Syrian fans in the rebel-held town of Binnish, on the outskirts of Idlib, watch a World Cup 2018 qualification soccer match between Iran and Syria, played in Tehran, on Sept. 5. (Omar Haj Kadour/AFP/Getty Images)

Bound by FIFA security restrictions, the team has also lost the advantage of home turf, bouncing instead between third countries that agree to host matches.

Some Syrians viewed Tuesday's match in Tehran as a rare chance to put war to one side and just enjoy a good game. For others, those tensions were inescapable, prompting one Istanbul cafe to advertise its screening as a politics-free zone.

According to Anas Ammo, a Syrian sportswriter, at least 13 league soccer players are missing or in government detention. Almost 50 have been killed by government forces.

The game also featured unusual geopolitical undertones, with Syria facing a team backed by an Iranian state that has bankrolled and militarily supported Assad's brutal conflict against opposition forces. This prize was a spot in the 2018 World Cup tournament held in Russia, Assad's other main backer.

A supporter of Syria’s national soccer team at the World Cup 2018 qualification match between Syria and Iran at Azadi Stadium in Tehran. (Atta Kenare/AFP/Getty Images)

"For me, it's like seeing Iran's A team against its B team," said Ali Haddad, a civil engineer who built major soccer stadiums back in Syria before fleeing the war and taking up residence in southern Turkey.

As Tuesday's match wore on and the slicker Iranian team pulled ahead with two goals, fans in the Beirut neighborhood of Hamra veered between hope and resignation.

"No one expected us to achieve like this. Not even me, but here we are, just a match away from the big one," said Ahmed Mohamed, an English-language student in Beirut who counts himself as the team's "most optimistic fan."

Not everyone saw the fairy tale. Critics accused Assad of using sports — especially soccer — to boost the government's legitimacy as his armed forces remain locked in one of the century's most devastating wars. Almost 6 million refugees have poured out of Syria since 2011. Monitoring groups say government forces are responsible for the overwhelming majority of the conflict's dead — almost half a million.

"My heart still loves Syria and will always want the team to do well. Then my head tells me what this regime has done to its people, and I realize the game is just another step toward Assad turning a page on the destruction of his country," said Haddad.

Dejection also set in among supporters as Tuesday's match crossed into stoppage time with Iran ahead 2-1. Syrian state television showed hordes of supporters sitting glumly by a statue of Assad's late father and longtime president, Hafez al-Assad. In Beirut, men and women slumped with heads in hands.

And then came Syria's equalizer, sending the crowds into paroxysms of delight and disbelief. The scorer was 28-year-old Omar Somah, a striker who only recently returned to the team after four years in exile. In Tehran's Azadi Stadium, cameras caught a member of the Syrian team's coaching staff sliding down on his knees and screaming joyfully with tears in his eyes.

A draw in a parallel match between Uzbekistan and South Korea had guaranteed Syria a place in the playoff rounds and another shot at World Cup qualification.

In Beirut, Majd Sarsar, a student from Damascus, described the final whistle as a moment of unity for a nation sorely lacking in hope.

"This wasn't about politics for me. It was just about sport. But tonight, I feel together with my countrymen. I do. And we needed that."

Zakaria reported from Istanbul. Heba Habib in Stockholm and Liz Sly in Beirut contributed to this report.