The U.S. plays Group A winner The Netherlands on Saturday. Group B winner England plays Group A runner-up Senegal on Sunday.
The U.S. finished second in Group B with five points (1-0-2) to reach the knockout stage for the sixth time in 11 World Cup appearances.
Iran (1-0-2, three points) only needed a tie to advance out of group play for the first time.
In the 93rd minute, a header by Morteza Pouraliganji missed the left post by a foot and in the 97th minute Walker Zimmerman had a clearance a few yards in front of the goal.
Pulisic suffered an abdominal injury on the goal and was replaced at halftime Brenden Aaronson.
Pulisic paid the price putting the U.S. ahead. The play started with an over-the-top ball to Sergino Dest on the right side of the box by Weston McKennie.
Dest sent a header to the charging Pulisic, who volleyed the ball into the goal before crashing into goalkeeper Alireza Beiranvand. Pulisic was on the ground for several minutes and struggled in his return to the field of play.
Pulisic has 22 goals in 55 international appearances.
Tim Weah almost added to the lead in the sixth minute of stoppage but was ruled offside by inches to nullify the score.
The match was played amidst tensions between the countries at a political level. That tension spilled over to the teams when the U.S. Soccer Federation on Sunday briefly displayed a graphic of the Iranian flag without the Islamic republic emblem. It was a way of showing support for protesters in Iran who are fighting for women’s rights.
The Iranian government wanted the U.S. team banished from the World Cup. U.S. coach Gregg Berhalter said the team had no prior knowledge before the posting of the flag.