AUSTIN, Texas — Lewis Hamilton could have settled in for a nice Sunday drive to win the Formula One championship.

There was no chance he was going to do that. Not with history at his fingertips.

Hamilton wrapped up his sixth career F1 championship with a second-place finish at the U.S. Grand Prix, a race he led late until surrendering the position to Mercedes teammate Valtteri Bottas in the final laps.

The 34-year-old British driver moved with one of the record seven titles won by Germany's Michael Schumacher. Hamilton has won the last three championships and locked this one up with two races left.

"Still we rise!" Hamilton shouted to his team over the car radio after the checkered flag.

Once he parked, Hamilton stood on his car and grabbed his head in both hands, then draped himself in a Union Jack flag. Minutes later, rival Ferrari driver Sebastian Vettel, whose run of four straight titles was ended by Hamilton in 2014, embraced him with a handshake and a hug.

The sixth championship moves Hamilton past Argentina's Juan Manuel Fangio, the "Godfather" of F1 drivers who won five titles in the 1950s.

"It's an honour to be up here with these (past) greats," Hamilton said.

Hamilton has been a dominant force at the Circuit of the Americas, with five wins here since it opened in 2012, but a poor qualifying left him starting from the third row in fifth. He said after qualifying he'd need a "miracle" to win, then tried to make it happen.

Hamilton avoided trouble at the start as the cars bolted uphill into the blind left turn that can turn the field into a demolition derby. He stayed clear of the dangerous traffic and gave Red Bull's Max Verstappen and Ferrari's Leclerc plenty of room to avoid a collision.

Hamilton turned the race on its head with a bolt to third on the first lap when he passed the Ferraris of Vettel and Charles Leclerc. That made the championship all but inevitable, as a finish as low as eighth would clinch it.

Hamilton wasn't going to settle for that.

He secured the 2015 title on the same track when he fought off Mercedes teammate Nico Rosberg in the final laps to get the victory. He was somewhat disappointed in in 2017 and 2018 when he clinched those titles in Mexico City without reaching the podium either time.

That made a podium Sunday a must.

"My dad taught me when I was like 6 or 7 years old to never give up. That's our family motto," Hamilton said. "That's all was thinking all day, 'How could I win this race?'"

Bottas was the only driver still mathematically in the hunt for the title, but just barely. Bottas had to win and have Hamilton fade to his worst finish of the year in order to extend the championship to the Brazilian Grand Prix in two weeks.

Bottas started from pole and was off and running with a good start. Hamilton grabbed the lead when Bottas pitted for tires and he wouldn't let it go without a fight.

Hamilton defended against a Bottas pass attempt with six laps remaining before finally surrendering the spot on the next lap.

"Winning it was the only thing I could do to try to maintain the title hopes," Bottas said. "I did my part but Lewis was still strong, as he always is."

Verstappen was looking to pass Hamilton on the final lap, but a yellow flag caused by Haas driver Kevin Magnussen ended the threat and gave Mercedes the 1-2 finish.

The Circuit of the Americas had a special parking spot next to the podium reserved for the championship car.

There was only one car that could be. It was a silver Mercedes No. 44.

"I remember watching this sport when I was younger," Hamilton said. "It's beyond surreal to think that this journey, that my life journey has brought me to this point."