MELBOURNE, Australia — Playing a five-set match for just the third time in his career, Canadian Denis Shapovalov couldn't hold off a late rally from his opponent in the second round of the Australian Open.

Shapovalov fell 6-3, 3-6, 6-1, 6-7 (4), 5-7 to Jo-Wilfried Tsonga on Wednesday to be eliminated from the first major of the year.

"It's not really something you can train for," Shapovalov said of the match that lasted three hours 37 minutes. "I think it's just experience. You have to go through it. You have to play these matches.

"Like today, Jo has so much experience playing these matches, I don't have that much, that could have been the difference. He picked up his game when he needed to."

The 18-year-old from Richmond Hill, Ont., looked in control in the fifth set with an early break to go up 2-0. He had a chance to close out the match on serve at 5-3, but was broken by Tsonga.

The Frenchman won five straight games in the fifth to complete the victory.

"Just didn't play a good game on my serve. Then he picked up his level," Shapovalov said.

Tsonga will next face either Australia's Nick Kyrgios or Viktor Troicki of Serbia, who played later Wednesday.

The Frenchman smashed nine aces and converted on 3-of-8 break points. Shapovalov had 11 aces and was 4-of-11 on breaks.

Shapovalov, who was making his Australian Open debut, got out to a good start and had an early break in the first set to go up 3-1. He finished the opening set with five winners.

Tsonga rallied in the second and went ahead 4-2 after breaking Shapovalov.

The third set was all Shapovalov with him jumping out to a 3-0 set advantage before cruising to the set victory. Shapovalov, ranked No. 50 in the world, had 11 winners and two aces in the set.

Tsonga, the No. 15 seed, jumped ahead early in the fourth set tiebreak and forced a decisive fifth set.

Shapovalov won the only prior matchup between the two men during the second round of last year's U.S. Open at Flushing Meadows.

The Canadian had defeated Stefanos Tsitsipas 6-1, 6-3, 7-6 (5) of Greece in the Australia Open's first round.

Shapovalov rocketed up the ATP standings last year, starting at No. 250 and reaching a career-best No. 49 over the summer.

He reached the semifinals of the Rogers Cup in Montreal in August, becoming the youngest semifinalist at a Masters 1,000 event, then followed that up by reaching the fourth round of the U.S. Open.