Edmund produced an impressive display to beat Kazakhstan’s Mikhail Kukushkin 6-3 6-3 in the first rubber of the tie.
Even though Dan Evans then lost to Alexander Bublik, a convincing doubles win by Jamie Murray and Neal Skupski ensured GB set up a quarter-final clash against Germany on Friday.
In-Depth: Is this Nadal's best ever year?
"Today I just wanted to go on court and really give it my all,” said Edmund, who didn’t feature in GB’s opening tie against the Netherlands.
It was such a buzz to thrive off this crowd. Davis Cup, playing for your country - it doesn't get any better.
Edmund has struggled for form this year and has slipped down to No 69 in the world.
However, he produced a high level to beat Kukushkin in just one hour and 14 minutes in Madrid.
"My performance was good. When I got the opportunity I wanted to really take it," said Edmund.
"I have been playing well in practice and wanted to transition that onto the match court and I felt I did that. I managed the game well and managed the opponent well - he’s tricky with the way he hits the ball. In the second set he had a few break point opportunities and I saved them and then punched the match home. It was a good day."
GB play Germany on Friday with the winner playing Spain or Argentina in the semi-finals.