Match ends, USA 2, Portugal 2.
Silvestre Varela's equaliser deep into injury time kept Portugal in the World Cup as their Group G clash with the USA ended in a dramatic draw in Manaus.
The substitute headed in a Cristiano Ronaldo cross after it appeared Clint Dempsey had sent the Americans through.
Portugal took an early lead through Nani, but Jermaine Jones' superb strike levelled the scores just after an hour.
A draw between Germany and USA will see both through, while Portugal must beat Ghana to have a chance of progressing.
Portugal are relying on a Germany win and must also achieve a six-goal swing if they are to pip the USA to second place and reach the last 16.
Realistically, they had needed to win in the Amazonian rainforest after a 4-0 thrashing by Germany in their opening game, but their performance was at least a marked improvement on that showing in Salvador.
For the USA - who had opened with a late win over Ghana - this was a performance characterised by attacking verve and defensive slackness, the latter allowing the European side to race into a fifth-minute lead, and also to hit back with the final whistle seconds away.
Their first defensive lapse came when Geoff Cameron sliced an attempted clearance across the face of his goal to Nani, the Manchester United winger finishing emphatically past Everton keeper Tim Howard.
The early goal stung the Americans into action, and they chased the game to create decent chances from which Clint Dempsey and Michael Bradley failed to test Portugal keeper Beto.
But while Portugal looked vulnerable to the USA's rapid counter-attacks, they remained a threat going forward themselves and went close to doubling their lead just before the break when Nani struck the post from outside the area, and Eder's follow-up was brilliantly pushed over by Howard.
Ronaldo's participation had been in some doubt following a bout of tendonitis in his left knee, and while the World Player of the Year looked good when supplying his team mates, his finishing was wayward.
Ten minutes into the second half, Bradley should have equalised, but the midfielder's side-footed shot from close range was superbly cleared off the line by Ricardo Costa.
The miss was soon forgotten, though, when Jones side-stepped Nani before bending in a brilliant shot from outside the box beyond the static Beto.
With less than 10 minutes to go, Dempsey stooped to guide the ball in off his midriff from close range for what looked to be the winner, until the defence switched off again in the 94th minute and Varela dived to meet Ronaldo's cross and claim what might still turn out to be a crucial point.
USA coach Jurgen Klinsmann: "When you concede in the last second it is unfortunate, but it was an amazing game from us - I can't ask for any more. Now we have to get a result against Germany and that is what we are going to do.
"We will take even more confidence into the next game. It will be another final but that is what the World Cup is about.
"Germany played yesterday and so have more time to recover. We played in the Amazon and they haven't had to travel much. Everything has been made easy for the favourites, whereas we have to struggle to go through, but that is what we will do."
Portugal manager Paulo Bento: "It's clearly not a good result for us. The 2-2 doesn't put us out of the World Cup mathematically, but it does leave us in a very difficult situation.
"Not just because of what we'll need to do against Ghana, but also because we'll need a favourable result from the Germany-United States game.
"We were unlucky late in the first half, but it was a great effort to level the match (in second-half stoppage time).
"Now all we can do is to give everything in our very last game and try and make the most of the very little chance that we have left."
- 11BedoyaSubstituted forYedlinat 72'minutes
- 13JonesBooked at 75mins
- 8DempseySubstituted forWondolowskiat 87'minutes
- 19ZusiSubstituted forGonzálezat 90+1'minutes
- 21da Silva Pereira
- 19AlmeidaSubstituted forWilliam Carvalhoat 45'minutes
- 13Moreira da Costa
- 2Bruno Alves
- 8João Moutinho
- 16MeirelesSubstituted forVarelaat 69'minutes
- 23PostigaSubstituted forMacedo Lopesat 16'minutes
- 17Almeida da Cunha
- 7Cristiano Ronaldo
- 1Dos Reis Carvalho
- 6William Carvalho
- 9Pereira de Almeida
- 10Vieira de Freitas
- 11Macedo Lopes
- 12Rui Patrício
- 15Ferreira da Silva
- Néstor Pitana
- Shots on Target
Second Half ends, USA 2, Portugal 2.
Goal! USA 2, Portugal 2. Silvestre Varela (Portugal) header from the centre of the box to the bottom right corner. Assisted by Cristiano Ronaldo with a cross following a fast break.
Attempt missed. Cristiano Ronaldo (Portugal) header from the centre of the box misses to the right. Assisted by Miguel Veloso with a cross.
Substitution, USA. Omar González replaces Graham Zusi.
Attempt missed. Cristiano Ronaldo (Portugal) header from the centre of the box misses to the right. Assisted by João Moutinho with a cross.
Corner, Portugal. Conceded by Tim Howard.
Substitution, USA. Chris Wondolowski replaces Clint Dempsey.
Offside, Portugal. Miguel Veloso tries a through ball, but Eder is caught offside.
Attempt blocked. Miguel Veloso (Portugal) right footed shot from outside the box is blocked. Assisted by João Moutinho.
Foul by Jermaine Jones (USA).
Silvestre Varela (Portugal) wins a free kick on the left wing.
Delay over. They are ready to continue.
Delay in match DaMarcus Beasley (USA) because of an injury.
Attempt blocked. Eder (Portugal) right footed shot from outside the box is blocked.
Goal! USA 2, Portugal 1. Clint Dempsey (USA) with an attempt from very close range to the centre of the goal. Assisted by Graham Zusi.
Attempt blocked. Michael Bradley (USA) left footed shot from the centre of the box is blocked.
Attempt missed. Nani (Portugal) left footed shot from outside the box is too high. Assisted by João Moutinho.
Delay over. They are ready to continue.
Delay in match Matt Besler (USA) because of an injury.