MEXICO CITY (AP) Lewis Hamilton kept up the pressure and Nico Rosberg responded on his final lap.
The Mercedes duo will start 1-2 at the Mexican Grand Prix on Sunday after Rosberg rallied from difficult practice sessions to join his teammate at the front of the starting grid.
Hamilton earned pole position Saturday for the second week in a row as he pushes to cut Rosberg's 26-point lead in the driver's championship with just three races left.
''I'm going to try to do the same thing I did last Sunday,'' Hamilton said of his victory at the U.S. Grand Prix. ''The car feels great.''
Rosberg's leap into second position came just as the qualifying expired. And it came after three practice sessions when he struggled to match his rival's pace. Late into qualifying, it looked like Rosberg would be locked out of the front row for the first time since Japan in 2015.
Earning the front row start is critical. Even if Hamilton wins, Rosberg's lead is big enough that he can clinch the title by finishing second twice and third once in the final three races of the season. That would match the 1982 season championship won by his father Keke Rosberg .
Rosberg's best lap of was 0.254 seconds slower than Hamilton.
''Lewis' lap was brilliant, not so much mine,'' Rosberg said. ''I put it together in the end though.''
Hamilton has been in top form chasing Rosberg of late. His win in Texas kept alive his slim title homes with hopes he can keep pressuring Rosberg into a mistake.
But Rosberg's season has been relatively problem-free, with nine wins so far as Hamilton has been bedeviled by problems. Hamilton had a comfortable late lead in Malaysia when he was knocked out of the race with an engine problem. The defeat handed Rosberg a commanding lead for his first career season championship.
Hamilton also has been dogged by poor starts much of the season: His previous 10 pole positions have resulted in only four victories. Hamilton avoided a similar problem in Texas when he led from start to finish, but Rosberg couldn't resist a jab Saturday to remind him of his struggles from the front.
''As we've seen, pole position isn't everything on Sunday,'' Rosberg said.
Red Bull's Max Verstappen and Daniel Ricciardo will fill out the second row Sunday, with Force India's Nico Hulkenberg fifth ahead of the Ferrari duo of Kimi Raikkonen and Sebastian Vettel.
The two Mexican drivers, Force India's Sergio Perez and Haas F1's Esteban Gutierrez had disappointing qualifying sessions in front of their cheering home crowd. Perez will start 12th and Gutierrez 17th.
Rosberg dominated the Autodromo Hermanos Rodriguez in 2015, winning an easy race from pole position. Hamilton said he's much more comfortable on the surface and racing in Mexico City's high altitude this year. The 2015 race was Formula One's first at the circuit since 1992.
''Last year we were sliding around a lot,'' Hamilton said. ''Today it feels a lot more like a racetrack.''
A Hamilton victory Sunday would be career win No. 51, tying him with Alain Prost for the second-most in Formula One. Michael Schumacher holds the record with 91.