The Scot was defeated in straight sets 6-3, 6-3 by unseeded 20-year-old Croatian Borna Coric in what is arguably the best result of his career.
The player, who is currently ranked 49th in the world, outplayed Murray, who has been in poor form of late and only recently lost in the semi-finals in the Godo Tournament in Barcelona.
Novak Djokovic progressed into the quarter-finals with a more convincing display that on Wednesday, when he defeated Feliciano Lopez 6-4, 7-5 in straight sets.
The poor weather in Madrid led to the roof at the Manolo Santana court being closed which took some of the effectiveness off Lopez's powerful serve, giving Djokovic an advantage in a tournament held at altitude where the ball is considered to fly faster than at other events.
Rafael Nadal also had an easier time following Wednesday's three-set marathon against Italian Fabio Fognini. The top-ranking Spaniard and four time winner in Madrid needed just an hour and 12 minutes before knocking out Australian 16 seed Nick Kyrgios 6-3, 6-1.
Japan's number 6 seed, Kei Nishikori also enjoyed a straight-set win over a Spaniard, as he beat veteran David Ferrer 6-4, 6-3 to also move into the last eight.
There was a slight surprise as number 5 seed Milos Raonic lost 6-4, 6-2 to Belgian number 9 seed David Goffin
The quarter-finals of the women's tournament saw Simone Halep, the highest surviving seed, breeze past American Coco Vandeweghe 6-1, 6-1, while 14 seed, Kristina Mladenovic defeated Sorana Cirstea 6-4, 6-4 and unseeded Latvian Anastasija Sevastova had a straight-set triumph 6-3, 6-3 against Kiki Bertens.