World Cup 2010 - Khedira heads Germany to third
The Stuttgart midfielder headed into the corner of the net on 82 minutes after a frantic scramble in the Uruguay box.
Thomas Muller struck the opener for Joachim Loew's side on 19 minutes only for Edinson Cavani to level on 28 minutes.
Diego Forlan put Uruguay ahead with a delicious volley on 51 minutes. Germany secured the bronze medal courtesy of Marcell Jansen's header five minutes later before Khedira pounced in a crowded area to convert the winner.
It was the fifth time that Germany were involved in a third place play-off.
Germany are the first side to win the third place play-off game in back to back World Cups.
No country has played more matches for the bronze medal, but they were fortunate not to be reduced to ten men in the fourth minute.
How Perez's leg did not buckle in two remains something of a mystery.
Uruguay went close on six minutes when Forlan's swerving free-kick flew over.
Germany's response saw Arne Friedrich's header hit the bar from Mesut Ozil's corner before they struck on 18 minutes courtesy of Muller's mindfulness.
Forlan almost became the fourth man to reach five goals on 24 minutes when he headed at the German goal, but Per Mertesacker did well to block the Atletico Madrid striker's header. His time would soon come.
Germany, without Miroslav Klose due to a back problem amid a flu bug in the squad, contributed to their own downfall when they lost the equalising goal on 27 minutes.
Perez picked Schweinsteiger's pocket before Suarez, who was roundly booed for much of the game due to his handball antics against Ghana in the last eight, slipped Cavani in for the equaliser.
Suarez screwed a shot wide of goal before the break, but Forlan showed him how to do it when he volleyed Egidio Arevalo's cross into the net on 51 minutes to take his tournament tally to five. It was a glorious finish that was a small emblem of the outstanding Forlan's work at this tournament.
Muslera allowed Germany a way back in 56 minutes when he missed Jerome Boateng's corner and the ball hit off the head of Jansen for the equaliser.
Khedira completed an impressive World Cup with the winner from Ozil's corner, but Forlan almost forced the match to extra-time when he slammed a free-kick off the bar with the final kick of the ball that would have edged him ahead in the Golden Boot prize.
Germany's win denied Uruguay their best finish at the finals since winning the tournament 60 years ago, but they can luxuriate in the memory of wins over Mexico, South Korea and Ghana and a narrow 3-2 loss to the Netherlands in the semi-finals.
Muller leads the Golden Boot because he has the highest number of assists, but Klose's ailment cruelly robbed him of the chance to equal or overhaul Ronaldo's all-time World Cup record of 15 goals. He remains one short of the Brazilian on 14 goals.
Uruguay v Germany
1st Half Goals 1-1
Shots on Target 6-7
Shots off Target 5-7
Blocked Shots 5-4
Yellow Cards 1-3
Red Cards 0-0
Passing Success 76.1%-81.3%
Tackles Success 87.1%-71.4%
Territorial Advantage 48%-52%