Madrid, Spain, 22 November 2019 | tennis.com.au / AAP

Canadians Vasek Pospisil and Denis Shapovalov combined brilliantly to defeat John Peers and Jordan Thompson and stop Australia’s run in the Davis Cup quarterfinals in Madrid.

Scores were locked at 1-1 heading into the decisive doubles rubber, after Pospisil beat John Millman — a replacement for the injured Nick Kyrgios — in the opening singles rubber and Alex de Minaur stopped Shapovalov in a three-set thriller.

Pospisil and Shapovalov broke the Aussie duo in the very first game of the match and recovered from 3-0 down in the second set to complete a 6-4 6-4 victory.

“Nick woke up this morning with a problem. It was with his collarbone and he was unable to play,” Australian Davis Cup captain Lleyton Hewitt said. “John came in and did his best, but we are all very disappointed to be out.”

Canada becomes the first nation to progress to the semifinals, and will next face either Serbia or Russia for a place in the final of the revamped competition.

Earlier, De Minaur fought back from a set down to keep Australia’s hopes alive with a 3-6 6-3 7-5 win over Shapovalov.

When Shapovalov stormed through the first set the signs looked ominous. But what De Minaur may lack in physical power he makes up for with grit, fight and determination and he hit back to win the second set after being blown away in the opener by the mercurial left-hander.

Rocked by the Australian’s fightback, the world No.15, who beat De Minaur in the 2016 junior Wimbledon final, fell apart, hitting a series of unforced errors.

De Minaur won all three of his singles rubbers in Madrid.

“I knew it was never going to be easy,” he said in an on-court interview.

“It was one of those matches where I had to try and keep going and give myself chances. It was important to get that break at the end and win the match for my team and keep us alive for the doubles.

“I felt like I am playing for my teammates, playing for my country there was no chance I was going to show any negative emotion and work hard every single point to give myself the chance to win.”

Millman went into action to open the tie after Kyrgios suffered a flare-up of the collarbone injury that had sidelined him since late September.

In his first outing of the week at the Davis Cup Finals, Millman started well against the big-serving Pospisil, breaking serve in only the second game of the match.

However, the 29-year-old broke back to level the set at 4-4 and then saved two set points to take a tense tiebreak.

Millman struggled to deal with the Pospisil’s power game in the second set and while he gamely hung in the set, he was unable to hold serve at 5-4 down and the Canadian forced an error to seal victory.

It was announced an hour before the start of match Millman would replace Australian No.2 Nick Kyrgios, who had been in superb touch in the opening two singles rubbers against Colombia and Belgium and who hurled down 38 aces in his two straight-sets victories.