Jannik Sinner stunned Novak Djokovic as Italy beat Serbia to set up a Davis Cup final against Australia on Sunday.
Serbia took the lead in the semi-final when Miomir Kecmanovic beat Lorenzo Musetti 6-7 (7-9) 6-2 6-1 in the first singles rubber.
But Sinner showed his class to beat world number one Djokovic 6-2 2-6 7-5 and level the tie.
Sinner and Lorenzo Sonego then defeated Djokovic and Kecmanovic 6-3 6-4 in the doubles to secure a thrilling victory.
Sunday’s final will be broadcast live on BBC iPlayer and the BBC Sport website from 15:00 GMT.
An enthralling day in Malaga began with an entertaining first set between Kecmanovic and Musetti, which the swashbuckling Italian took on a tie-break.
But as the match went on, it became clear Musetti was beginning to struggle physically, and the consistent Kecmanovic took the second set comfortably before cruising through the third to put Serbia in front.
In a high-quality second singles match, world number four Sinner saved three match points to inflict a first Davis Cup defeat on Djokovic since a retirement against Juan Martin del Potro 12 years – and 21 matches – ago.
This was Djokovic and Sinner’s third meeting in 12 days after they played twice – winning one apiece – at last week’s ATP Finals in Turin.
Sinner was unplayable in the opening set as the 24-time Grand Slam champion looked uncharacteristically lost on court, but Djokovic hit back to level the match as his opponent’s level dropped.
The deciding set was filled with quality, grit and drama in a raucous atmosphere and Sinner saved three match points from 5-4 and 40-0 down, then broke Djokovic before serving out the match.
That took the tie into the doubles, and Italy looked comfortable in taking the opening set.
At one point, the crowd booed Djokovic – who had told a group of British fans to “shut up” earlier in the week – and he reacted by gesturing like a conductor.
He had no response to Sinner’s blistering groundstrokes, though, and an inspired Sonego helped take Italy to their first Davis Cup final in 25 years.
“I just tried to push in every single point and the 0-40 game helped the confidence and also after I broke him,” said Sinner. “It’s all part of tennis.”