Germany goalkeeper Jens Lehmann saved twice in a shootout to give the hosts a 4-2 win on penalties over Argentina after their World Cup quarter-final had ended 1-1 after extra time.
Lehmann saved penalties from Roberto Ayala and Esteban Cambiasso, while Germany scored all four of their spot kicks.
There were ugly scenes after the shootout with players jostling each other on the pitch.
Germany now play Italy or Ukraine in the semi-finals.
Ayala had put Argentina ahead with a flying header four minutes into the second half and the South Americans looked comfortable until goalkeeper Roberto Abbondanzieri was forced off with an injury in the 71st minute.
Germany threw on Tim Borowski four minutes later and his intervention led to the Germany equaliser.
Michael Ballack crossed from wide on the left, Borowski nodded the ball on and Miroslav Klose beat replacement 'keeper Leo Franco with a well directed header.
Christoph Metzelder headed over from a corner and Luis Gonzalez smacked a shot well wide with the only clear chance in extra time.
Argentina, World Cup winners in 1978 and 1986, had controlled a cautious first half played under grey skies at the Olympiastadion.
The German supporters making up the vast majority of a 72,000 crowd were left whistling in frustration as Argentina kept possession.
Germany committed players forward just once and it almost paid off in the 16th minute.
Bastian Schweinsteiger passed to Bernd Schneider on the right and his well judged cross picked out Ballack. The Germany captain was unchallenged but his header flashed wide.
The game changed when Ayala arrived late to head in a Juan Roman Riquelme corner in the 49th minute, throwing himself in front of his marker Klose to make thumping contact.
Germany were left with no option but to return to the direct style that is their hallmark under coach Juergen Klinsmann.
Ballack shot straight at a defender when the ball broke to him in the 64th minute in what was the best chance for the Germans before the injury to Abbondanzieri.
David Odonkor had come on after an hour and his pace caused Juan Pablo Sorin problems on the Argentina left, especially as the defender had to be cautious, having picked up a booking.
Germany kept pressing and were rewarded when Borowski's excellent header set up Klose to score his fifth goal of the tournament and send an absorbing game into extra time.