Great Britain reached the Davis Cup Finals last eight in remarkable fashion as Dan Evans and Neal Skupski saved four match points before winning a nerve-wracking decider against France.
In front of a partisan British crowd in Manchester, Evans and Skupski beat Nicolas Mahut and Edouard Roger-Vasselin 1-6 7-6 (7-4) 7-6 (8-6).
Evans won from a set and a break down in the singles but Cameron Norrie lost.
Evans and Skupski, roared on by the home fans, recovered to seal victory.
"It was bonkers. I don't know what we've all sat through for nine hours," British captain Leon Smith said.
Britain will now go on to the knockout phase of the men's team competition - known as the Final Eight - in Spanish city Malaga in November.
Four nations - Britain, Australia, France and Switzerland - played in the round-robin event at Manchester's AO Arena, with the top two countries going through.
With Australia already qualified and Switzerland eliminated, Britain knew nothing other than a victory in the best-of-three tie against France would enable them to progress.
What few of the 13,000 crowd - a record for a Davis Cup tie in the UK - would have predicted was the dramatic manner in which their goal was finally achieved.
Evans, 33, laid the platform for the win when he fought back to beat French teenager Arthur Fils 3-6 6-3 6-4.
British number one Norrie, 28, could not get his side over the line as he lost 7-6 (7-5) 3-6 7-5 to Ugo Humbert, teeing up the winner-takes-all doubles match.
Evans and Skupski, who have become Smith's first-choice doubles pair, recovered from a poor start against their experienced rivals before growing in confidence as the boisterous home fans lifted their spirits.
When Britain sealed victory at almost 22:00 BST, Evans fell to the court in disbelief as Skupski leapt into the air when he watched a French return go long.
The pair were quickly mobbed by their team-mates and support staff, including a union jack bucket-hat-wearing Andy Murray.
"I don't know how to react," said Skupski. "It was just sheer fight."
Evans added: "The guys on the bench said 'get the crowd involved'. It turned into pandemonium.
"There was some embarrassing stuff from me, but it doesn't matter, we're going to Malaga."
More to follow.Live scores, results and order of playAlerts: Get tennis news sent to your phone
What's next in the Post Office Horizon scandal? Nick Wallis continues his investigation into the widest miscarriage of justice in UK legal historyThe batsman who changed the face of cricket: How wearing a helmet revolutionised the safety of the sport