World number four Medvedev’s first career victory over the 20-times Grand Slam champion sent him through to a Sunday showdown against Dominic Thiem who earlier beat Novak Djokovic in another titanic clash.
The 24-year-old Medvedev reached the semi-finals as the only player to post a 100% record in his group, including a superb defeat of Djokovic.
He was the better player in the opening set against Nadal but one lapse on serve was all the Spaniard required to snatch it.
Medvedev blew a big lead in the second set when Nadal was one point away from going down 5-1, but Rafa swung the match his way and served for a place in the final at 5-4, only for Medvedev to break to love.
A forehand winner helped Medvedev move 5-3 ahead in the tiebreaker and he took full advantage to set up a decider.
Nadal appeared to be feeling the pace in a tense final set and some sensational winners allowed Medvedev to grab the crucial break of serve in the seventh game.
Two games later Nadal dumped a backhand in the net to hand Medvedev a landmark victory.