Sebastian Vettel won the German Grand Prix after a battle with Lotus's Kimi Raikkonen and Romain Grosjean.
The Red Bull driver held off Raikkonen, who made a late pit stop from the lead to benefit from the extra grip of fresh tyres in the closing laps.
Raikkonen passed Grosjean under orders with five laps to go, the Frenchman holding off Ferrari's Fernando Alonso.
Mercedes' Lewis Hamilton faded from pole to finish fifth, passing McLaren's Jenson Button on the last lap.
Sebastian comes home
"I was pushing really hard throughout and I'm very happy to finally win in Germany"
Sebastian Vettel, Red Bull
Vettel put himself in a position to control the race by passing Hamilton off the start line into the first corner.
But a safety car in the middle of the race closed up the field and left Vettel holding off Grosjean and Raikkonen, with Alonso running fourth.
The three front-runners ran nose-to-tail from the restart on lap 36 until Grosjean made his final stop on lap 40, with Vettel following him in the next time around.
Raikkonen and Alonso, though, stayed out for a further nine laps and fitted the faster but more fragile 'soft' tyres.
The Finn rejoined 2.3 seconds behind Grosjean, who was 1.5secs behind Vettel, with Alonso a further 4.4secs behind.
Raikkonen closed in on Grosjean, who was ordered to let the Finn by with five laps to go, and had five laps to close the 2.5-second lead to Vettel.
He closed to within a second at the start of the final lap but although that put him in the range that allowed him to use the DRS overtaking aid, he was too far back when he entered the zone leading up to the final chicane and Vettel held on to win by one second.
"That was a tough one," Vettel said as he whooped in delight over the team radio on the slowing down lap.
It was Vettel's first victory in his home race and the 30th of his career.
"Unbelievable, I'm very happy," said Vettel. "Kimi was pushing very hard in the race, they tried to do something different with different compound tyres.
"I was pushing really hard throughout and very happy to finally win in Germany.
"I could feel him coming with more and more pressure. I had some laps when Romain was very close.
"We lost Kers in the middle of the race for a couple of laps as well. Very happy the race ended on lap 60 and not lap 61."
"We had a think about whether we stay out to the end," said Raikkonen. "But we had a problem with the radio. They couldn't hear me but I could hear them. I'm wondering whether we could have [won if we had not pitted]."
Alonso was just 0.7secs behind Grosjean heading into the final lap but slowed down as he approached the chequered flag, and was told by his team to pull off at Turn One immediately after taking the flag.
The result extends Vettel's lead in the championship to 34 points over Alonso, who is seven ahead of Raikkonen, with Hamilton a further 17 behind.
The Mercedes driver struggled with heavy tyre wear but held on well and fought back from a final pit stop with 15 laps to go to pass Button in a superb move around the outside of Turn Two on the final lap.
The final points positions were taken by Red Bull's Mark Webber, who was running second to Vettel until a wheel came off as he accelerated away from his first pit stop.
The Australian rejoined a lap behind, which he was able to make up as a result of safety car intervention, and he fought up well into the points, to beat McLaren's Sergio Perez, Mercedes Nico Rosberg and Sauber's Nico Hulkenberg.
Webber's wheel hit a cameraman from the official F1 TV company FOM. Paul Allen suffered a broken shoulder and cracked ribs but remained conscious throughout. He has been taken to Koblenz Hospital, where he is under observation.
Red Bull were subsequently fined 30,000 Euros by race stewards.
The safety car was deployed because Jules Bianchi's Marussia rolled backwards across the track after the Frenchman pulled off on lap 23 with an engine failure.