The hosts celebrated the 100th anniversary of football in the country with a brilliant win over Joachim Low's men, who tried in vain to stage a late comebackGermany ended their American tour with a 4-3 loss to the USA in a thrilling encounter in Washington.
An early strike from Jozy Altidore and Marc-Andre ter Stegen's own goal put Jurgen Klinsmann's side into a commanding half-time lead. Heiko Westermann pulled one back just after the break, and Clint Dempsey's double sealed the victory, despite late efforts from Max Kruse and Julian Draxler.
Celebrating the 100th anniversary of football in America, the hosts came out with early intent, and it took a fine challenge from Per Mertesacker to deny Altidore in the opening stages.
The AZ man had another chance soon after, meeting Graham Zusi's right-wing cross at the near post, but sending his header wide. But soon enough, the Germans sprung into life.
After a corner kick was only partially cleared, the ball was worked into the box from the left wing. Benedikt Howedes scuffed his initial effort but it fell kindly to Mertesacker, who shrugged off DaMarcus Beasley but side-footed the ball wide when he should have done far better.
But, just as Joachim Low's men seemed to be getting a foothold in the match, disaster struck. Zusi scampered down the right once more and sent in a brilliant cross to Alitdore, who broke his international scoring drought by capitalising on some slack marking before volleying home.
Fabian Johnson then sent a shot wide before things went from bad to worse. Benedikt Howedes, under pressure from pressing attackers, sent an easy pass to Ter Stegen, who inexplicably let the ball run past him before his poor control sent it into the net.
After going 2-0 down, Germany went about trying to find a path back into the match. Andre Schurrle came in off the right and dribbled past a host of players before working an angle to shoot but could not get his effort on target.
Miroslav Klose thought he had pulled one back with a dainty side-footed effort after running clear, only to see his effort correctly chalked off for offside, before Julian Draxler forced Tim Howard into a save with a volley and Lukas Podolski blasted over.
Germany came out of the blocks much faster in the second half, threatening down either flank before they finally got their goal. Max Kruse, on as a sub at half-time, went down the left and forced a corner. He stepped up to take it himself and found Westermann in the middle and the Hamburg man headed home.
But while they were more impressive going forward, they remained vulnerable at the back. Beasley had already ghosted through the whole defence and forced Ter Stegen into a save when Altidore crossed to Dempsey, who smashed the ball beyond the young keeper.
And soon enough, it looked to be all over. Dempsey turned Podolski, playing as a defensive midfielder, and bent a brilliant left-footed effort beyond Ter Stegen.
Julian Draxler forced Howard into a save with an acrobatic effort and Germany gave themselves a glimmer of hope through Kruse's brilliant 20-yard strike.
And, with 10 minutes to spare, they seemed to be on the verge of something miraculous. Sidney Sam cut in from the right and struck a shot, Howard parried his effort to Draxler, and the teenager tapped home to set up a grandstand finish.
Germany pressed and probed for an equaliser and had convincing appeals for a penalty on Nicolai Muller turned down in stoppage time but the hosts held on to record a result they deserved.