It didn't go as planned, but Lewis Hamilton's ninth-placed finish at the Mexican Grand Prix was enough to make him Britain's first four-time Formula One world champion.
"It doesn't feel real. It is not the kind of race I wanted, 40 seconds behind, but I never gave up. That is what is important and in my heart. I am grateful for today," Hamilton said.
Red Bull's Dutch driver Max Verstappen won the race comfortably ahead of Hamilton's teammate Valtteri Bottas and Ferrari's Kimi Raikkonen.
Hamilton joins Vettel and Alain Prost as a four-time champion. Only two drivers have achieved more - Michael Schumacher (seven) and Argentine Juan Manuel Fangio (five). Hamilton has now won more world championships than Sir Jackie Stewart, Niki Lauda and Ayrton Senna.
On the first corner, Hamilton's worst fears came true as a collision with Sebastian Vettel dropped both drivers to the back of the field. Hamilton's tire was punctured and Vettel's car needed a new nose.
Vettel drove brilliantly to finish fourth from 19th, but he fell short of the top-two finish he needed to keep Hamilton from celebrating. The Briton diligently worked his way back into ninth, constantly checking on Vettel and his progress. Although ninth proved somewhat anti-climatic for Hamilton, it didn't stop the 32-year-old from celebrating his record-breaking title.
Hamilton had to turn things around this season after Vettel took the lead in the early part of the season. After finishing fifth and fourth, Hamilton's stunning win at the British GP restored his belief. Winning at Ferrari's home track in Monza might have been the turning point though. Vettel finished third as Hamilton took charge in the championship, leading by just three points.
Once Hamilton had established a 34-point lead in Malaysia, Vettel's retirement after four laps in Japan left Hamilton on the home straight. And in Mexico, he crossed the finishing line as world champion for a fourth time.
The 2017 season still has two races left, in Brazil and Abu Dhabi.
Relive the Mexican GP below:
— Neymar even sent a message over the radio to Hamilton to congratulate him. He is the first Briton to have won four titles - a really stunning achievement. All eyes on him now.
— "Thank you to everyone on this team for all the fantastic work. God bless you," Hamilton says over the radio, with a wavering voice. He hardly has time to get out of his car before F1 reporters jump into action. Talk about not having a chance to enjoy his moment of history.
LEWIS HAMILTON IS YOUR 2017 F1 CHAMPION!
FINAL LAP — Verstappen takes the win! Sebastian Vettel with a great driver, but his fourth place finish means Lewis Hamilton, who crosses the line in ninth, is the 2017 F1 Champion! It is Hamilton's fourth Formula One title!
69/71 — A proper battle there, but Hamilton does take him in the end and with three laps remaining, Hamilton is into ninth and can feel pretty safe about the title now. He won't win it by winning in Mexico, but I'm not sure he'll care by the end of it. Verstappen close to his third ever race win, Bottas and Raikkonen the others on the podium.
67/71 — Alonso making life difficult for Hamilton to pass. Old dog, same tricks it seems.
66/71 — If Hamilton wins, he will have won as many title as Vettel and Alain Prost, and one more than Jackie Stewart. It would be one almighty achievement. But he has to get there first. His car appears to be cooling the car, or his brakes, because he is driving differently. Not finishing would be a disaster... I think we might be set in these positions. Verstappen to win ahead of Bottas and Raikkonen. Vettel in fourth, Hamilton in 10th.
63/71 — Sainz pits and looks out. Hamilton keeps checking back to make sure where Vettel is and how he's doing. He's very calm, considering he's also driving a vehicle at considerable speed. He's on the verge of winning the title and that must be clearer now as we approach the final few laps.
62/71 — Vettel asks how far ahead Raikkonen is. He's told he's 23 seconds ahead. "Mama mia" is the German driver's response. "That's a bit too much." Is this the end of the charge? It's a massive gap to close and only has 10 laps to do it in.
60/71 — Vettel with the fastest lap, again. Verstappen a huge 17.5 seconds ahead of Bottas in second. Vettel takes Ocon and now makes fourth. It might well be forgotten as Hamilton will likely win the championship, but what a driver this is from Vettel. Ericsson's car on fire as he pits to sort problem. That's his race done.
58/71 — Hamilton asks what position he needs. He's told Vettel is fifth and needs second and won't make it. That is where we are, although no one has told Vettel beause he is still driving like he can finish second.
56/71 — Can anything stop Vettel? He dives inside Stroll at Turn 1 and he has fifth spot. What an effort this is. In doing so he delivers a new lap record, as you do.
54/71 — Kudos to Fernando Alonso. Up into 9th from an 18th-placed start. Hamilton takes Vandoorne to move into 11th. Vettel closing in on Stroll now. The German is driving to the limit. Unless anything dramatic happens with the top two (Verstappen and Bottas), it looks like this epic drive will be in vain for Vettel.
52/71 — What a move! Vettel sneaks in to take Perez, who doesn't close the door through the chicane. The Ferrari driver is into 6th now.
49/71 — Over the radio, Hamilton is told he is forecasted to finish 8th. At the moment, he is 12th. Vettel still in 7th. Feels like everyone has found their spot a bit now, other than Hamilton who continues to make moves gradually.
45/71 — Gasly holding Hamilton at bay... But not for long. He passes and is now into 13th. Both drivers at the top of the standings driving superbly.
42/71 — Worth remembering, Hamilton will be world champion if it stays like this - and will do so by picking up no points. Vettel needs to make up 15 seconds to keep his charge toward second going. Big ask. Verstappen out in front by 10 seconds. Comfortable.
40/71 — Vettel is up into eventh after taking Magnussen. What drama we have here. Hamilton is doing his best to fight back but he's clearly concerned about Vettel's charge. Hamilton sails past Wehrlein to take 14th. Verstappen is on the way to winning his third F1 race. Leading and in charge - and at 20 as well.
37/71 — Hamilton around 29 seconds behind Vettel. The Briton can't believe he is that far back. 15th for the Mercedes driver, Vettel into 8th. The German still needs a top two spot remember.
36/71 — So, how fast can Hamilton go now? Bottas delivers a new fastest lap, then Raikkonen delivers an even faster one (1:20.649). Verstappen's lead is up to 9.1 seconds. His to lose now... Verstappen ahead of Bottas and Raikkonen.
34/71 — Hamilton and Vettel pit, so do the top three (Verstappen, Bottas and Raikkonen). All plans to take them to the end of the race. Hamilton opts for super-softs.
33/71 — Hartley's car is warm. Virtual Safety Car (VSC) is on. Hartley is out of his car and it is doused. Hartley is out. Time for box mayhem with VSC...
32/71 — Perez passes Magnussen, who pits, and the home crowd roars with delight! Vettel up into 8th after passing Alonso. This is going to be quite the finish. Approaching the halfway stage. Vettel just delivered the fastest lap (1:20.698).
30/71 — Hamilton up to 18th, but only because of the retirement. "Is anyone else making it through?" he asks. Vettel is and he is told that - sure that won't go down well. However, moments later, Hamilton takes Sainz and is up into 17th. Long time left yet. Verstappen still leads, but worried about his front left tire.
27/71 — Hulkenberg was well placed, but his car is now off the track! Renault's problems continue. Shame for Hulkenberg, but was told over the radio that the car was no longer safe and he had to get out!
25/71 — What a race this is from Vettel. The German flies past Vandoorne to take 11th. Next up, Alonso. Hamilton still can't believe he can't get close to a car. Frustration already for the Mercedes man.
23/71 — Vettel up into 12th. He must win or finish second to keep title hopes alive. Verstappen just lapped Hamilton! Can't remember the last time that happened. 2013 in Spain I'm told, was the last time (Hamilton finished 12th).
21/71 — "Just to get past these guys is difficult," says Hamilton over the radio. He is still stuck in 19th. Hulkenberg pits, Raikkonen up into fourth.
20/71 — The Mexican crowd stands, fists raised, in memory of those who lost their lives in the recent Mexico earthquake. A somber moment.
19/71 — Bottas delivers the fastest lap. Timely. He needs that if he wants to catch Verstappen. Perez into the box, Raikkonen into fifth now then. Pink car comes out into 8th.
17/71 — Verstappen posts the fastest lap. Vettel 53 seconds off the lead, Hamilton 68 seconds back from first. Vettel takes Gasly, who gives him plenty of room. Raikkonen stuck behind Perez.
15/71 — Ocon driving well in third, faster even than Bottas (the man in second). Vettel closing in on Gasly in 14th. Hamilton still in 19th.
13/71 — Who is where after that start? Vettel pushes out Massa after a bump and a stretch on the grass.
12/71 — No investigation will be made into the incidents between Verstappen, Vettel and Hamilton at the start. That's that then (don't think it will be). Fifth-placed Perez holding off Raikkonen.
9/71 — Ricciardo is out with a turbo issue.
8/71 — Hamilton asking over the radio whether Vettel hit Hamilton's back-right tire on purpose. The Mercedes team say they don't know, and no does know other than the German driver. On viewing though, it did look like he could have got out of the way...
6/71 — Ricciardo is in the box, and drops down to last. Hamilton working hard but still in 19th. Vettel up to 16th. Five cars in the pits early on there. Blimey.
4/71 — Can't believe how fortunate Verstappen was in all that mess. He probably deserves some after his season, though. Massa pits with a puncture, Wehrlein also in.
2/71 — I can barely keep up with what is happening. Verstappen leads from Bottas and Ocon. Hamilton at the back in 20th, Vettel in 18th.
Lap 1/71 — And we're off! So much drama I can barely type. Verstappen pushes Vettel in the second chicane, Hamilton tries to take advantage. Vettel loses some of his nose, Hamilton has a flat tire. Wow. Both box, both get replacement parts. Hamilton going to need some drive now...
— There's 890 meters between the pole position and the first corner. Plenty of space for an overtake early on... Lights out approaching!
— Crowd in Mexico is quite excited. Lots of costumes linked to the Day of the Dead which begins on October 31. The warm-up lap has started...
— Just 15 minutes to go until the start of the race and while clouds are in the sky, it is dry at the moment. If Lewis Hamilton wins this, or even does to win the championship, is it time to start the conversation about the greatest British athletes of all time? Certainly an argument that Hamilton has had to work for this title more than any one before...
— So with Vettel on pole, Hamilton will have some work to do if he wants to win the race. If you want more on how qualifying for the Mexican GP went, give this a click.
— So, what a moment it could be for Lewis Hamilton tonight. He could become the first ever Briton to win four drivers' championship titles. Sebastian Vettel will be trying to stop, and from pole position too. Here's what you need to know about how Hamilton can win the title tonight: