PARIS - Second seed Andy Murray survived his second successive five-set French Open battle to reach the third round Wednesday, avoiding what would have been his worst Grand Slam loss in eight years.

Murray, three times a semi-finalist, wore down France's world number 164 Mathias Bourgue, who had never won a tour-level match before this week, 6-2, 2-6, 4-6, 6-2, 6-3 and goes on to face 37-year-old Ivo Karlovic for a place in the last 16.

After coming back from two sets to love down to beat Radek Stepanek, also 37, in the first round in a tie played over two days, the British star had looked down and out once again on Wednesday. After pocketing the third set, 22-year-old Bourgue, reduced to tears by the end, had break points for a 1-0 lead in the fourth. But once they were squandered, the Frenchman's challenge quickly wilted as the physically stronger Murray raced away with 12 of the last 15 games.

Karlovic, the 27th seed, defeated Australian wildcard Jordan Thompson 6-7 (2/7), 6-3, 7-6 (7/3), 6-7 (4/7), 12-10, unleashing 41 aces and 102 winners. Karlovic is the oldest man in the French Open third round since 38-year-old Jimmy Connors in 1991.

Defending champion and third seed Stan Wawrinka defeated New York-born Taro Daniel of Japan 7-6 (9/7), 6-3, 6-4 and goes on to face France's Jeremy Chardy. Japan's fifth seed Kei Nishikori, a quarter-finalist in 2015, coasted into the last 32 with a 6-3, 6-3, 6-3 victory over Russia's Andrey Kuznetsov. Nishikori, the 2014 US Open runner-up, goes on to face former world number seven Fernando Verdasco of Spain.

Eighth-seeded Canadian Milos Raonic had few problems with Adrian Mannarino of France, winning 6-1, 7-6 (7/0), 6-1. Australian 17th seed Nick Kyrgios needed just 70 minutes to beat Dutch lucky loser Igor Sijsling 6-3, 6-2, 6-1. He will now meet French ninth seed Richard Gasquet who defeated fellow former boys champion Bjorn Fratangelo of the United States 6-1, 7-6 (7/3), 6-3.

In the women's event, second seed Agnieszka Radwanska, a quarter-finalist in 2013, beat Frenchwoman Caroline Garcia, the Strasbourg champion last weekend, 6-2, 6-4. Spanish fourth seed Garbine Muguruza defeated French wildcard Myrtille Georges 6-2, 6-0 and next tackles Belgium's Yanina Wickmayer. Sixth seed Simona Halep, the losing finalist to Maria Sharapova in 2014, came back from 4-1 down in the first set to beat Zarina Diyas of Kazakhstan 7-6 (7/5), 6-2.

Halep, 24, will next face Japan's Naomi Osaka, the world 101 who has reached the third round at a major for the second successive time having also enjoyed a run to the last 32 in Australia. Osaka, 18, knocked out 34-year-old Mirjana Lucic-Baroni 6-3, 6-3 which would have been a relief to Halep who lost to the world number 52 Croatian at the French Open last year and US Open in 2014.

Petra Kvitova, the 10th seed, saw off Taiwan's Su-Wei Hsieh 6-4, 6-1 in a much more comfortable outing than her opener against Danka Kovinic where she had been just two points away from defeat. Kvitova, a semi-finalist in 2012, next faces Shelby Rogers of the United States. Russian 13th seed Svetlana Kuznetsova, the 2009 champion, was too strong for Britain's Heather Watson winning 6-1, 6-3.

Kuznetsova will now face Fed Cup teammate Anastasia Pavlyuchenkova who saw off Cagla Buyukakcay, the first Turkish woman to win a match at a Grand Slam, 6-3, 4-6, 6-1.