Murray upset world No. 14 Shapovalov 6-1, 3-6, 6-2 in two hours and nine minutes to set up a round of 16 match against the old foe and world no Novak Djokovic.
The 34-year-old Scot, who marked his return on clay for the first time in two years with a straight-set win over Dominic Thiem in the first round, proved too strong for Shapovalov in the deciding set.
Murray took an early lead, breaking Shapovalov’s serve twice en route to winning the opening set in 36 minutes.
The British number three, behind Cameron Norrie and Dan Evans in the domestic rankings, put more pressure on Shapovalov’s serve in the fifth game of the second set.
But Murray wasted two break points and was broken for the first time in the next game to trail 5-2 before Shapovalov served with a set after an hour and 25 minutes.
The deciding set went at serve until the fifth game before Murray used his first break point of the set to take a 4-2 lead.
The Scot, currently 78th in the ATP rankings, held again at 5-2 and took a 40-0 lead on Shapovalov’s serve before celebrating another impressive win with his third match point.
Murray reversed his decision to skip the entire clay-court season after he was handed a wildcard for Madrid and four weeks of practice on the surface appear to have paid off.
Murray has not played against Djokovic since the Qatar Open in January 2017, when the Brit was world number one. The Serb won in three sets.
Djokovic beat France Gael Monfils 6-3 6-2 in his second round match after getting a bye in the opening round.
https://www.independent.co.uk/sport/tennis/andy-murray-novak-djokovic-denis-shapovalov-gael-monfils-madrid-b2071069.html Andy Murray entered the third round of the Madrid Open with a fine win over Denis Shapovalov