MADRID - Canada has advanced to the semifinals at the Davis Cup Finals.

Denis Shapovalov of Richmond Hill, Ont., and Vasek Pospisil of Vancouver beat Australia's John Peers and Jordan Thompson 6-4, 6-4 in the winner-take-all doubles match on Thursday.

Canada won the best-of-three tie 2-1 and will face Serbia or Russia in the semifinals on Saturday.

“As soon as we decided the team, from the first point we were just going maximum intensity, energy, focus,” said Pospisil. “We came very focused.”

Pospisil, ranked 150th in the world in singles after missing the first half of 2019 following off-season back surgery, is now 4-1 at the Finals.

Shapovalov missed a chance to clinch the tie for Canada, losing 3-6, 6-3, 7-5 to Alex de Minaur of Australia in the second singles match.

“Kind of took my foot off the gas after the first set, plus he took his game to another level,” said Shapovalov.

Earlier, Pospisil beat Millman 7-6 (7), 6-4.

The quarterfinal win guarantees Canada will be in the 2020 Finals. The four semifinalists do not have to go through qualifying.

Shapovalov's loss was Canada's first in six singles matches at the event. De Minaur, 3-0 in singles at the tournament, broke Shapovalov to take a 6-5 lead in the third set and finished off the Canadian on his second match point.

The contest featured two 20-year-olds ranked in the top 20 - Shapovalov is 15th, while de Minaur is 18th.

“He played an extremely good match,” said Shapovalov. “Second and third set I felt like I was playing catch up. I didn't feel like the better player today.”

Pospisil, meanwhile, recorded his third major upset at the Finals. He has beaten No. 12 Fabio Fognini of Italy, No. 36 Reilly Opelka of the United States and No. 48 Millman this week.

Pospisil, 29, fought off two set points in the opening tiebreak before taking it. He is now 4-0 in tiebreaks this week.

The Canadian broke Millman in the final game to win the match.

Pospisil won 85 per cent of his points when he got his first serve in and had the 15-1 edge in aces.

Pospisil was a late addition to Canada's starting lineup for its opening tie against Italy with Felix Auger-Aliassime making his way back from an ankle injury.

While Canada has said Auger-Aliassime could play, team captain Frank Dancevic elected to ride the hot hand in Pospisil against Australia.

Pospisil has been the surprise star of the event, building momentum off some solid results on tour in recent months.

A former world No. 4 in doubles and No. 25 in singles, Pospisil beat then-No. 9 Karen Khachanov at the U.S. Open this year and reached the round of 16 at the Shanghai Masters. Pospisil also won two lower-level Challenger tournaments this fall.

“It's been an amazing week so far. The sky's the limit. With a little luck on our side anything can happen,” said Dancevic.

Milos Raonic, the world No. 31 from Thornhill, Ont., did not make the trip due to a back injury.

The Davis Cup was first played in 1900 and Canada made its first appearance in 1913. Canada reached the World Group semifinals in 2013.

The competition is using a new format this year with the six group winners and the next two best teams advancing to the quarterfinals. The final is set for Sunday.

This report by The Canadian Press was first published Nov. 21, 2019.