The US was trailing 1-0 after the first half, but took a 2-1 lead in the second half before giving up the game-tying goal in the final seconds of extra time. Here is how it all unfolded, in GIF form:

In the 64th minute, Jermaine Jones tied the game with this fantastic shot:

In the 81st minute, Clint Dempsey gave the US the lead for the first time with a pelvic thrust of a goal:

In the 90th minute with five minutes of extra time, Varela headed in a perfect feed from Cristiano Ronaldo. With mere seconds remaining Portugal faced elimination if they lost to the US. A draw kept both teams alive, and that is how it ended.

Here is how the scenarios stand for the group after the tie: