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.

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.

WATCH | Canada heads to Davis Cup semis after doubles win against Australia:

Vancouver's Vasek Pospisil beat Australia's John Millman 7-6 (7), 6-4 in the first singles match, and then he teamed up with Denis Shapovalov of Richmond Hill, Ont., to win the deciding doubles match, as Canada advanced to the Davis Cup semifinals. 1:59

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

The quarter-final 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.

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.

The Aussies elected to rest No. 30 Nick Kyrgios.

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, from Vancouver, also won two lower-level Challenger tournaments this fall.

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 quarter-finals. The final is set for Sunday.