Evans recovered from a set and a break down to defeat teenage debutant Arthur Fils and then, after Cameron Norrie had lost a close battle against Ugo Humbert, teamed up with Neal Skupski for a hugely tense 1-6 7-6 (4) 7-6 (6) victory over Nicolas Mahut and Edouard Roger-Vasselin.
The British pair saved four match points in the deciding set before clinching their second match point in the tie-break, sparking scenes of huge jubilation.
The 2-1 win earned Britain top spot in their group and booked their place in November's final eight week in Malaga, where a quarter-final against either Italy or Novak Djokovic's Serbia awaits.
A sell-out crowd of 13,000 at the AO Arena, a single-day record for the competition in Britain, also played its part as Leon Smith's side completed an unbeaten week after earlier successes against Australia and Switzerland.
"About 6-1 in the first set I thought he'd picked the wrong team," said Evans. "Thanks to every single one of you. It turned into pandemonium.
"Some embarrassing stuff probably out there but we're going to Malaga so it doesn't matter.”
"It was bonkers," said Smith. "I don't know what I've just sat through for nine hours."
There was nothing to choose between the teams from the start, with Evans digging very deep to claim a 3-6 6-3 6-4 victory over 19-year-old Fils.
Fils is the highest-ranked teenager in the world at 44 and the most exciting of a crop of young French players.
It was immediately clear this was not a comfortable match-up for the 5ft 9in Evans, who struggles to impose his finesse-based game against power hitters, and he was in deep trouble when he was broken for a second successive game at the start of the second set.
Fils played a poor game serving at 3-2 to allow Evans back into the contest and from there a combination of the crowd, smart play by the British number two and his opponent's inexperience turned things around.
Evans had to come through a tense final game, leaping and punching the air before expressing annoyance at his opponent for a very perfunctory handshake.
Evans' victory gave Norrie the chance to clinch the tie, with Smith keeping faith with his number one despite his disappointing last few months and a loss to Stan Wawrinka on Friday.
Norrie saved a set point to force a tie-break in the first set against his fellow left-hander Humbert but blazed a backhand wide after fighting back from 2-6 to 5-6.
Norrie, ranked 19 places higher at 17 in the world, turned things around with some gritty play in the second set and for much of the decider looked the better player but he double-faulted to hand a 7-6 (5) 3-6 7-5 victory to his delighted opponent.
Evans had talked about the influence watching Davis Cup matches in Birmingham as a boy had had on him, saying: "For me, that was the be all and end all, was to play Davis Cup for your country, and it still is."
This was now his chance to earn the crucial point as he returned to the court alongside Skupski.
Roger-Vasselin and Mahut have a combined age of 80 but also a wealth of experience at the very top of the doubles game and they seized control from the start.
Evans and Skupski got into the contest in the second set and urged the crowd to up the noise levels but they were unable to apply any real pressure to their opponents' serve.
They played a superb tie-break, though, finding their rhythm on return and ensuring the tie would go all the way to the final set.
The British pair were now hugely fired up and there was more tension between Evans and Fils, sat courtside, in the early stages of the decider as the hosts pushed for a break.
It appeared all over when a double fault saw Evans trail 0-40 in the 10th game but he stood firm to save all three match points, and Skupski sent down an ace to save a fourth two games later.
They trailed 4-2 in the deciding tie-break as well but their fightback was not finished.