Germany’s plans were hindered in the pre-match warm-up as Sami Khedira was injured and replaced by Christoph Kramer, who lined up for his first competitive start.
The game got off to a lively start and it was Argentina who had the first clearcut chance on 21 minutes, when Toni Kroos’ badly-judged back-header fell straight to Gonzalo Higuain, who moved within 18 yards from goal but dragged a right-footed strike wide of Manuel Neuer’s upright.
Kramer’s appearance was short-lived following a hefty collision with Ezequiel Garay, and he was helped off the pitch and replaced by Chelsea forward Andre Schurrle on the half-hour mark, before Higuain thought he had made amends for his miss when he side footed home a superb cross from Ezequiel Lavezzi, only to see the offside flag go up.
The next chance fell to sub Schurrle, who was teed up by Thomas Muller but saw his side footed effort palmed away to safety by goalkeeper Sergio Romero.
Lionel Messi was looking dangerous and went on a fine run that ended with Jerome Boateng hacking clear near the goal line on 39 – and Kroos should have done better on 43 when Germany broke swiftly after Javier Mascherano lost possession, only for the Bayern Munich man to fire his shot straight at Romero.
On the stroke of half-time, Germany should have taken the lead as Kroos delivered a perfect corner into the danger zone, where Benedikt Howedes had a free header but steered the ball against the upright from close range.
After the break, Argentina’s coach, Alejandro Sabella sent on Sergio Aguero for Lavezzi and they flew out of the traps quicker than Germany, with Messi dragging an 18-yard angled drive wide of the upright.
Higuain did well to recover from a crunching collision with Neuer on 58, then Miroslav Klose had a chance to add his record tally of 16 World Cup goals but failed to get any power on a header that was easily saved by Romero.
Messi then created a chance for himself with 16 minutes remaining, curling a 20-yard shot wide of the target, while Higuain was left to ponder what might have been when he made way for Rodrigo Palacio on 77.
Germany pressed in the closing stages and started to stretch the tiring Argentines, with Mesut Ozil brilliantly picking out Kroos on the edge of the 18-yard box, only to see his team-mate fail to get a low side footed shot on target.
Klose made way for Gotze to a standing ovation from fans as the curtain fell down on his illustrious World Cup career in the dying minutes, while Fernando Gago replaced Enzo Perez as both coaches prepared for extra-time.
This time Germany were brightest after the break and on 91 Gotze set up Schurrle, whose half-volley was palmed away by Romero before Boateng executed a wonderful tackle to stop a swift Argentina counter-attack.
Marcos Rojo’s through ball fell for Palacio on 97 and he chest-controlled before lifting the ball over the on-rushing Neuer, only to see it drop wide of the upright with Boateng shepherding it out of play.
At the start of the second extra-time period, Bastian Schweinsteiger was left with a bloodied face following a collision with Aguero, who appeared lucky to avoid punishment for his arms-up challenge on the German midfielder, then Palacio should have seen yellow for a tug on Philipp Lahm’s shirt.
Both decisions drew angry responses from the Germany bench – but they were all up in celebration on 113 minutes, when Schurrle went on a dazzling run down the left flank and crossed for Gotze, who chest-controlled the ball before smashing a stunning left-footed volley past Romero and into the back of the net.