LONDON — Canada's Felix Auger-Aliassime is off to the quarterfinals of the Queen's Club tournament after a bizarre finish to his second match on Thursday.

The No. 8 seed from Montreal beat seemingly distracted Nick Kyrgios 6-7 (4), 7-6 (3), 7-5 in a second-round match at the ATP Tour 500 grass-court event.

The outspoken Australian was booed by some fans after the match following a controversial day at the tournament.

Kyrgios, facing deuce in the final game, tried a between-the-legs shot that did get over the net but put Auger-Aliassime in a favourable position to win the match. The Canadian then finished it with a winner on a service return that Kyrgios barely moved for.

Before the match, in video posted by Tennis TV, a fan shouted "Let's go Felix, you got this." Kyrgios responded: "He honestly probably does."

Earlier, Kyrgios, ranked 39th in the world, swore at officials and accused them of "rigging" his first-round match as the tournament tried to get back on schedule after plenty of rain earlier in the week.

Kyrgios, who went on to win the match, launched an expletive-ridden rant at umpire Fergus Murphy after missing a set point against Roberto Carballes Baena, claiming his Spanish opponent had double-faulted.

After Murphy issued a code violation for unsportsmanlike conduct, Kyrgios continued his tirade, saying "it's a joke, man. It's a serious joke" and adding: "Like, your hat looks ridiculous, also. It's not even sunny."

After another point, Kyrgios said: "The ball was this far out on the second serve. I'm going. I'm not going to give 100 per cent when I've got linesmen rigging the game, I don't want to play.

"You wonder why I don't try half the time. Literally the set had finished, he double-faulted. Why am I playing at 5-5? Absolute joke."

Later in the match, Kyrgios then berated himself for hitting a poor lob to gift Carballes Baena a point and made reference to a computer game.

"So lazy, do something, so lazy you are," he said to himself. "You were playing FIFA until 3 a.m., what do you expect?"

In the final game, Kyrgios — at 40-0 down — began returning from just outside the service line.

He still won the match 7-6 (4), 6-3.

The 18-year-old Auger-Aliassime will face top seed Stefanos Tsitsipas of Greece in the quarterfinals. The Canadian is 1-0 against the world No. 6, beating him at Indian Wells, Calif., on a hard-court earlier this year.

Auger-Aliassime set up his match with Kyrgios by beating Bulgaria's Grigor Dimitrov in the first round earlier Thursday.

The Canadian had 15 aces (Dimitrov had six) and won 85 per cent of his points on first serve.

Auger-Aliassime, 18, is coming off a run to the final at the Stuttgart Open, the first grass-court tournament of the season.

The win over world No. 45 Dimitrov looks good on the Canadian's resume. Dimitrov reached a career-high of No. 3 in November 2017.

Meanwhile, No. 6 seed Milos Raonic of Thornhill, Ont., advanced to the quarterfinals with a 6-3, 7-6 (3) win over qualifier Aljaz Bedene of Slovenia.

Raonic has won two matches in a row after dropping out of the Stuttgart Open before his semifinal against Auger-Aliassime with a back injury.

Raonic will face Spain's Feliciano Lopez in the quarterfinals.

— with files from The Associated Press