Lewis Hamilton beaten by team-mate Nico Rosberg in Austria

Nico Rosberg edged a close fight with Mercedes team-mate Lewis Hamilton to win the Austrian Grand Prix.

The Mercedes were competing with the front-row starting Williams for half the race before assuming the first two positions after the final pit stops.

Rosberg was left leading Hamilton, but with both managing brake problems the Englishman was unable to challenge.

Williams drivers Valtteri Bottas and Felipe Massa took third and fourth ahead of Ferrari's Fernando Alonso.

Massa converted his pole into a lead at the start, while Bottas was passed by Rosberg into the first corner, only to retake second place into Turn Two.

Austria GP: Lewis Hamilton gains five places on opening lap

Behind, Hamilton drove a sensational first lap after starting ninth following a spin in qualifying.

A great start put him fifth by Turn Two, and he then passed Alonso brilliantly for fourth into the fast Turn Eight at the end of the lap.

That meant Hamilton finished the first lap right on Rosberg's tail after starting six places behind him, and raised hopes he might be able to take the victory he needed to eat into the German's championship lead, which was 22 points at the start of the race.

The two Williams and two Mercedes ran nose to tail through the first stint, but Mercedes were able to get Rosberg ahead of both and Hamilton ahead of Massa when Williams chose to make later first pit stops.

Massa stopped from the lead on lap 14, three laps after Rosberg, and with Bottas stopping on lap 15 and Hamilton on lap 13, that left Rosberg ahead of Bottas, Hamilton and Massa for their second stint as all four trailed the Force India of Sergio Perez, which was on a different tyre strategy.

Perez held off Rosberg for 16 laps until lap 27, before the Mercedes swept past into Turn Two, Bottas following him through down the next straight.

Rosberg did not pull away from the Williams as much as might have been expected and Bottas, with Hamilton right on his tail, was able to stay within two seconds of the Mercedes until Rosberg's second stop on lap 40.

Nice Rosberg and Lewis Hamilton

Bottas stopped the next time around, but rejoined third behind Hamilton, who had stopped on lap 39 in a successful attempt to undercut the Williams.

That left Alonso in the lead until his stop on lap 47, the first time a Ferrari had led a race this season.

The Spaniard rejoined five seconds behind Massa, a gap he closed to nothing by lap 60, with 11 laps to go.

But with the under-powered Ferrari much slower than the Mercedes-engined Williams on the straights, Alonso could do nothing about passing his former team-mate.

At the front, Hamilton stayed within two seconds of Rosberg, but was warned that his brakes were on the limit and despite asking for advice from his engineers as to where he could gain time, he could not close in.

Rosberg's victory was his third of the season, and it extends his championship lead to 29 points, more than a race victory, his largest margin of the entire season.

Formula 1: Murray Walker on the rivalry between Lewis Hamilton and Nico Rosberg

"It wasn't the easiest of races trying to manage certain things," said Rosberg. "But I had a very fast car and it's great to win.

"I thought I would get Valtteri at the start, but they are so quick on the straights and he went straight past me. We had a bit more pace and less tyre deg [degradation] than the Williams so we could go aggressive on the stops and that's what we did.

"I generally felt comfortable in the last laps. The tyres started to drop away on the last lap but after I got past the first couple of hairpins I knew I would be fine."

Hamilton said: "We have been working very hard on the starts and the team have done a great job. I positioned the car in great places. That would have been great if I had started where I should have started, but damage limitation, to get from ninth to second and pressing Nico showed the pace I had this weekend."

"I'm really, really happy," said Bottas. "It's difficult to put into words. Thank you to the team for giving me this car. The race was exactly what we needed, clean, nice. I'm so happy."

Behind Alonso, Perez took advantage of doing his final stint on the super-soft tyres while his rivals were on the harder softs to pass Magnussen for sixth on lap 66 after the Dane made a mistake at Turn One, allowing Perez to get a run on him down to Turn Two.

Daniel Ricciardo gave Red Bull some cheer at the end of a poor weekend at their home race by passing Force India's Nico Hulkenberg for eighth around the outside of Turn Four on the final lap.

Alonso's Ferrari team-mate Kimi Raikkonen took the final point for 10th place after another disappointing showing for the Finn.

Austrian Grand Prix race results

Austrian Grand Prix coverage

Nico Rosberg

Rosberg has not finished out of the top two all season

Lewis Hamilton

Hamilton fell to 29 points behind team-mate Rosberg in the drivers' standings - more than one race victory

Sebastian Vettel

Vettel failed to finish for the third time this season - as many retirements as he had in the previous three years

Austrian Grand Prix fan

The race returned to Austria for the first time since 2003