Stefan Kozlov overcame leg cramps and upset Grigor Dimitrov 7-6 (8), 5-7, 6-2 to move into a second-round match against Rafael Nadal at the Mexican Open.

The No. 130-ranked Kozlov got a spot in main draw as lucky loser after Maxime Cressy withdrew because of injury.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Kozlov struggled with cramps in his right leg at the end of the second set, but continued to play and Dimitrov failed to take advantage in the match that lasted a tournament record 3 hours and 21 minutes.

Nadal, who won the Australian Open last month, is one of four Top 5 players in the draw at Acapulco alongside Australian Open runner-up Daniil Medvedev, defending champion Alexander Zverev and fourth-seeded Stefanos Tsitsipas.

Stefan Kozlov, of the U.S., returns a ball during a match against Grigor Dimitrov, of Bulgaria, at the Mexican Open tennis tournament in Acapulco, Mexico, Monday, Feb. 21, 2022. (AP Photo/Eduardo Verdugo)

The Mexican Open is an ATP 500 tournament. Since that category started in 2009, only Dubai in 2012 and Beijing in 2013 have featured four of the Top 5 players in the world.

The time it took for Kozlov’s win broke a tournament record set in a match earlier Monday, when John Isner outlasted Fernando Verdasco 7-5, 6-7 (4), 7-6 (3) in 3 hours, 13 minutes.

Isner, a semifinalist in Acapulco in 2019 and 2020, will next play either Cameron Norrie and Daniel Altmaier.

CLICK HERE TO GET THE FOX NEWS APP

In other first-round matches, seventh-seeded Taylor Fritz beat Adrian Mannarino 6-3, 6-3, Brandon Nakashima beat Peter Gojowczyk 6-4, 6-4, Dusan Lajovic fended off Sebastian Korda 6-4, 4-6, 7-5 and eighth-seeded Pablo Carreno Busta swept Oscar Otte 6-2, 6-4.

The Mexican Open is played on the hard courts in the Arena GNP in Acapulco, a popular beach resort.