DOHA, Qatar (AP)After a World Cup start clouded by a disastrous loss and persistent questions about the civil unrest back home, Iran is celebrating the prospect of its first ever trip to the knockout stage.

But first, Team Melli faces the United States.

Iran defeated Wales 2-0 Friday and collected the three points to rise from the bottom of Group B. England and the United States played to a scoreless draw on the same day – setting up a politically fraught match between Iran and the Americans on Tuesday that will decide which team goes through to the round of 16.

The prospects of advancement certainly weren’t as bright at the start of the tournament when Iran was routed by England 6-2.

”I told the players, very clear: Football is a game of a different moments. It’s not because you win or you don’t win. Sometimes you lose your dignity, you lose your honor. After the first game, we were bleeding in our pride,” said Carlos Queiroz, the Portuguese coach who also led Team Melli at the 2014 and 2018 World Cups.

Queiroz’s task was to convince his team that all was not lost. But at the same time, Iran’s players were facing pressure to answer for the wave of protests in Iran.

The turmoil was sparked by 22-year-old Mahsa Amini’s death in September while in custody for allegedly violating Iran’s compulsory dress code for women. Her death has become a rallying cry against the country’s treatment of women.

The players did not sing the national anthem before the loss to England in an apparent show of solidarity with protestors, but in the days before the match against Wales, it became clear that the team wanted to focus solely on soccer. Queiroz even sparred verbally with a reporter following a pre-match news conference.

The tensions were heightened following the reported arrest Thursday of former national team player Voria Ghafouri in Iran for his criticism of the government.

The players sang their anthem, although not forcefully, before the game against Wales and then went on to win on a pair of second-half stoppage-time goals. Rouzbeh Cheshmi, who scored the go-ahead goal, suggested afterward the team felt pressured.

”I believe at this time, certain things happened for the players that were not quite fair. I believe that they were judged improperly and therefore they received some non-football pressures,” Cheshmi said. ”I believe that the entire family of the Team Melli helped each other and as a result the entire team were able to win. I scored the goal, that is true, but the team did the work.”

But Iran could not entirely escape the discord at home: Outside the stadium pro-government fans clashed with the few who dared to wear ”Women, Life, Liberty” T-shirts, a slogan of the movement. Those in the shirts had to change before they were allowed in the stadium.

While the victory gave Iran back its joy, in the words of Quieroz, it will undoubtedly bring even more focus on geopolitics ahead of the deciding match with the United States. In addition to the over-arching tensions between the two nations, U.S. Soccer had taken a progressive stand for women’s rights, granting equal pay between its men’s and women’s team – including the equal division of World Cup prize money.

As it stands in Group B, if Iran can beat the United States, it will move on. The Americans win and they’ll advance, but a draw or a loss sends them home.

England leads the group after the scoreless draw with the Americans. England will qualify for the knockout stage with a win or a draw against Wales. The Welsh will need a victory to keep even slim hopes of advancing alive.

If Wales beats England, Iran will need at least a draw against the United States and goal difference will matter.

”Now we need to be sure that we are good enough to go to the second round. So we start immediately the preparation to play against the U.S., which is a brilliant team as well, as we saw them against Wales,” Queiroz said. ”Our preparation starts with a good rest, refresh the minds and put all the complementary and garbage things outside of our minds and focus on our goal, because what we want to do it to give this gift to Iranian fans.”

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