SHANGHAI - Lewis Hamilton sealed his first hat-trick of Formula One wins and led Mercedes to their third straight one-two finish at the Chinese Grand Prix as the team tightened their grip on the season Sunday. The former world champion got away smoothly from pole and was rarely troubled as he finished 18 seconds ahead of his team-mate Nico Rosberg, with Ferrari's Fernando Alonso third.Red Bull's Daniel Ricciardo outran his team-mate and reigning world champion Sebastian Vettel for fourth spot, with the Force India of Nico Hulkenberg coming home in sixth. But there was a bizarre finish when Hamilton was inadvertently shown the chequered flag early, meaning that the race was later declared over after 54 laps instead of the 56 completed."I was thinking 'am I seeing things?' I looked up as I was coming across the line expecting to do another lap and I saw a chequered flag," said Hamilton. "I asked the team, 'Was there a flag? And they said 'No' and I kept going," he added. The mishap did not change any race positions apart from Caterham's Kamui Kobayashi, who was demoted from 17th to 18th after his late pass on Jules Bianchi was ruled out.And it did not adversely affect Hamilton, who had a huge grin after his 25th grand prix win which takes him past legendary Argentine Juan Manuel Fangio and level with Niki Lauda and Jim Clark. Although he has now racked up consecutive wins in Malaysia, Bahrain and now China, the Briton still trails Rosberg by four points in the standings as he seeks to regain his 2008 world title."I can't believe how amazing the car is. I was able to look after the tyres and then I was racing myself," said Hamilton. Rosberg retained his championship lead with a dogged second place after fighting past the Red Bulls and Alonso despite telemetry problems and an early bump.For Ferrari, their first podium of the season was sweetly timed for new team principal Marco Mattiacci, who replaced Stefano Domenicali this week. But there was more woe for McLaren when both Jenson Button and Kevin Magnussen finished out of the points. No one was able to come close to Hamilton, who powered away from pole position and in dry, cool conditions, had a four-second cushion by lap six.Behind him Vettel moved up from third past his team-mate Ricciardo, as did Alonso who got a flying start in the Ferrari. The early drama came behind as Felipe Massa in the Williams dived past Nico Rosberg's Mercedes and banged his left rear wheel against Alonso's car. Rosberg, seemingly distracted by Massa's overtaking manoeuvre, then touched wheels with the other Williams of Valtteri Bottas on his outside but came through unscathed.It took Rosberg two laps to get back past Massa and when the first round of pit stops began on lap 12, the Williams crew could not remove Massa's damaged rear left. By the time they finally replaced it, Massa had been relegated to last place and the Brazilian eventually finished way down in 15th. Alonso stopped a lap earlier than Vettel in what proved a telling move as, with his rubber up to race temperature sooner, he got past the four-time world champion.Ricciardo pitted after 15 laps, dropping him behind Rosberg. Rosberg and Vettel became engaged in a wheel-to-wheel battle for third place on lap 23 from which the Mercedes driver emerged in front. Their fight enable Ricciardo to close on his team-mate and Vettel was asked to move over, as he had in Bahrain, to let the quicker Ricciardo through.But Vettel this time was less accommodating. "Tough luck," he said of Ricciardo's position over team radio, and he defended his fourth place only to be passed a couple of laps later. By lap 33, Rosberg had Alonso in his sights and was told to "push hard" to catch the Spaniard over team radio. Alonso responded by pitting, leaving the familiar sight of two Mercedes at the head of the field for the third race in a row until Rosberg himself stopped for a second time.Vettel was having a frustrating afternoon and with badly grained tyres, he suffered the ignominy of at one point being passed by the Caterham of Kamui Kobayashi, much to the Red Bull driver's disgust. Hamilton made his second and final stop on lap 38 and emerged from the pit lane with a 13-second cushion over Alonso. Rosberg was flying, however, and after setting the fastest lap he re-took second place by easily passing Alonso on a straight.The German remains top of the standings despite a tough weekend when he spun in qualifying and had telemetry problems which meant he had to keep his team updated on measurements over the radio. After four races out of 19, Mercedes already have a sizeable lead in the constructors' championship with 154 points, 97 more than second-placed Red Bull.