Germany beat USA 1-0 in Recife to reach the last 16 of the World Cup and were joined by the Americans as runners-up.
Both teams went into the game at a rain-soaked Arena Pernambuco locked on four points and knowing a point apiece would be enough to keep their Brazil dream alive.
Thomas Muller settled the affair in Germany’s favour with a ruthless finish from 18 yards out on 55 minutes – but Portugal’s 2-1 win over Ghana calmed American nerves in the closing stages as Cristiano Ronaldo and co also finished on four points but with an inferior goal difference to the USA.
Muller moved level with Lionel Messi and Neymar at the top of the World Cup scoring charts after netting his ninth goal in as many World Cup appearances – and his fourth in three games in Brazil.
Germany controlled much of the game, deservedly taking the three points to top Group G with two wins and a draw.
Following heavy overnight rain which had seen the city of Recife wake up to widespread flooding, a pitch inspection was required before the all-clear was given.
Both teams warmed up behind the goals to protect the surface as the rain continued to fall, evoking memories of Germany’s 1954 World Cup final triumph over a fancied Hungary in Berne.
This time, it was they who were heavily fancied to beat a nation coached by fellow German Jurgen Klinsmann, and it did not take a team including six Bayern Munich players and three from Arsenal long to prove why.
Straight into their possession-based game, Germany had the USA on the back foot for 10 minutes before Klinsmann’s men were finally able to get their feet on the ball for a prolonged spell.
The respite was only brief, though, as Germany once again started to dictate proceedings before, on the break, Graham Zusi went the closest yet to breaking the deadlock with a curling effort over the crossbar.
Mesut Ozil had Germany’s best chance of the first half, shooting straight at Tim Howard as Germany were unable to make the most of their apparent superiority.
Germany’s all-time top goalscorer Miroslav Klose was sent on at the start of the second half and he went within inches of connecting well with Bastian Schweinsteiger’s cross, but all he could do was flick the ball wide of Howard’s post.
The Germans shifted up the gears to increase the pressure on the USA and, 10 minutes into the second half, they got their reward.
Per Mertesacker’s header was pushed out instinctively by Howard, but the ball fell out to Muller, who picked his spot in the bottom right-hand corner of the goal from the edge of the penalty area for his fourth goal of the tournament.
Much had been made in the build-up of Germany’s non-aggression pact with Austria from the 1982 World Cup, when they obtained the 1-0 result in Gijon which took both nations through.
Thoughts of them replicating that in Recife and allowing the USA to get the draw they needed to be sure of joining them in the last 16 were soon dismissed, though, as Joachim Low’s men showed no sign of letting up.
They could not find the second goal they deserved though, and Philipp Lahm had to produce a last-minute block to preserve the win before Clint Dempsey headed over the crossbar from close range.
With Portugal unable to wipe out their negative goal difference in the other game in the group against Ghana, USA were also able to celebrate at the final whistle, joining Germany in the last 16 as group runners-up.