By Andrew Benson
Hamilton counts the cost of his error in the pit lane
The Englishman slid off the track on his way into the pit lane to change his tyres in a tricky wet-dry race.
He had already ceded the lead to Kimi Raikkonen's Ferrari and was being pressured by team-mate Fernando Alonso.
Raikkonen won from the Spaniard - and they will stage a title showdown with Hamilton at the final race in Brazil.
Hamilton leads with 107 points, ahead of Alonso on 103 and Raikkonen on 100.
The 22-year-old had a lead of more than eight seconds when he made his first pit stop on lap 15 of the 56-lap race.
That was cut to four by Raikkonen by the time the Finn had made his stop four laps later, but Hamilton still appeared to have the race under control.
The Briton's hopes started to unravel as the track began to dry a few laps later.
Hamilton drove beautifully in the early laps of the race
Raikkonen quickly closed in on Hamilton, who held his title rival off for two laps before falling foul of his lack of grip.
The McLaren ran wide going into turn eight on lap 29, allowing Raikkonen to sneak past on the inside at the next corner.
And then it all went wrong for Hamilton.
His right rear was completely worn out - a white line appearing around its circumference - as he battled to stay in front of Alonso on lap 30.
And coming into the pits, the rear of the car twitched away from the Briton as he tried to turn into the left-hand corner at the start of the pit lane.
Hamilton corrected it, but the car slid straight on into the gravel trap, where it was beached.
Hamilton tried to get the car out, but the rear wheels spun helplessly and, after imploring the marshals to help him, he finally admitted defeat and climbed out of the car.
Back on the track, the action was just as dramatic.
After Alonso came in for dry tyres on lap 32, he returned right in front of Ferrari's Felipe Massa, who had been running on his dry tyres for some laps and had more grip.
Raikkonen's win puts him right back in the title hunt
However, once he had cemented his position, Alonso began to carve into Raikkonen's lead, cutting it from more than 15 seconds to eight within eight laps before the Ferrari driver responded to stabilise the gap.
Raikkonen controlled the race for the remaining laps to take his fifth win of the season - one more than either Hamilton or Alonso, a fact that could be crucial at the final race.
Drivers tied on points at the end of the season are separated by a win countback.
Toro Rosso's Sebastian Vettel finished fourth ahead of Honda's Jenson Button after both drove superbly in the difficult conditions to take their best results of the season.
Vettel's result came after the novice was reprimanded for causing an accident behind the safety car in Japan.
Final positions after Chinese Grand Prix:
1 Kimi Raikkonen (Fin) Ferrari one hour 37 minutes 58.395 seconds
2 Fernando Alonso (Spa) McLaren-Mercedes at 9.8 seconds
3 Felipe Massa (Brz) Ferrari at 12.8 seconds
4 Sebastian Vettel (Ger) Toro Rosso-Ferrari at 53.5 seconds
5 Jenson Button (GB) Honda at 1:08.6secs
6 Vitantonio Liuzzi (Ita) Toro Rosso-Ferrari at 1:13.6
7 Nick Heidfeld (Ger) BMW Sauber at 1:14.2
8 David Coulthard (GB) Red Bull-Renault at 1:20.7
9 Heikki Kovalainen (Fin) Renault at 1:21.1
10 Mark Webber (Aus) Red Bull-Renault at 1:24.6
11 Giancarlo Fisichella (Ita) Renault at 1:26.6
12 Alexander Wurz (Aut) Williams-Toyota one lap behind
13 Jarno Trulli (Ita) Toyota one lap
14 Takuma Sato (Jpn) Super Aguri-Honda one lap
15 Rubens Barrichello (Brz) Honda one lap
16 Nico Rosberg (Ger) Williams-Toyota two laps
17 Sakon Yamamoto (Jpn) Spyker three laps
R 18 Robert Kubica (Pol) BMW Sauber 33 laps completed
19 Lewis Hamilton (GB) McLaren-Mercedes 30 laps
20 Ralf Schumacher (Ger) Toyota 25 laps
21 Adrian Sutil (Ger) Spyker-Ferrari 24 laps
22 Anthony Davidson (GB) Super Aguri 11 laps
Key: R = retired
Shanghai International Circuit: An image of the main straight and pitlane area
Shanghai International Circuit
File photo of Kimi Räikkönen (2008) 
Spa, 2007, his previous win
Ferrari driver Kimi Räikkönen won the FIA Formula-1 2007 Sinopec Chinese Grand Prix on the Shanghai International Circuit, Shanghai, China. This became the 200th GP win for Scuderia Ferrari and 600th podium for this Formula One team.

Vodafone McLaren Mercedes driver Lewis Hamilton gained pole in the qualification and was in the steady lead, but the tyre strategy gamble caused by a faulty rain predictions caused Lewis to lose control of his car on a pit lane entry carrying it to a gravel trap. This mistake became an unexpected opportunity for his rivals Kimi Räikkönen and Fernando Alonso in the Drivers' Championship. Alonso is four points behind and Räikkönen is seven points behind Hamilton.

While Alonso and Ferrari driver Felipe Massa were battling side by side right after the start of the race, Hamilton chased by the Finn managed to make a comfort gap to them. After Alonso finally passed Massa and strengthen his position he get into pursuit for Räikkönen's red car. Alonso was about ten seconds behind Räikkönen up on the finish line.

Sebastian Vettel rehabilitated himself for his previous fault and finished 4th. His teammate Vitantonio Liuzzi was 6th, splitted by Jenson Button's Honda from his younger companion.

Nick Heidfeld's BMW Sauber was 7th, while his teammate Robert Kubica was out while leading the race on the 33rd lap.

David Coulthard's Red Bull-Renault closed the top eight, three other Renault-engined cars right after him.