Defending champion Novak Djokovic did ease into the quarter-finals, though, with a 6-4, 7-5 win over Feliciano Lopez.
Coric also won his first ATP title, on clay, this year, beating the likes of Albert Ramos-Vinolas, Diego Schwartzman and Philipp Kohlschreiber en route to success in Marrakech.
He will play the quarterfinal against Dominic Thiem of Austria, who won a thriller against Grigor Dimitrov of Bulgaria 4-6, 6-4, 7-6 (9).
The player, who is now 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.
Djokovic will next face Kei Nishikori of Japan. Now he's in the quarters playing very good tennis.
After finishing the 2016 season on a high, Murray has struggled to replicate last year's form.
His first serve, which has been hindered by an elbow injury, was not to blame against Coric, who played aggressively and fluently and took full advantage of Murray's error-strewn performance.
"Things can change fast but you need to find exactly what it is that is going wrong and how you're going to fix that and commit to it".
But after failing to capitalise the Scot looked distracted as he remonstrated with his coaching staff as the second set went with serve until a bad eighth game from Murray gifted Coric the break once more.
Dozens hurt, 1 dead in violent day of protests in Venezuela
In March, Venezuela's Medical Federation said hospitals had less than 5 percent of the medicine needed to properly treat patients. A recent report released by the Health Ministry says that the number of women who died in childbirth in 2016 reached 756.
The 14-time Grand Slam champion had a slice of fortune as a let cord and a Kyrgios double fault handed him the two breaks he needed to take the first set.
"I played really well tonight". Djokovic saved the only break point he conceded to Lopez, who was playing in the tournament for a record 16th time.
Nadal faces David Goffin in Friday's quarterfinals after the Belgian beat world number six Milos Raonic 6-4, 6-2. The world number eight missed the Barcelona Open late last month due to the injury. The top-ranking Spaniard and four time victor in Madrid needed just an hour and 12 minutes before knocking out Australian 16 seed Nick Kyrgios 6-3, 6-1.
A finalist in Madrid in 2014, Nishikori lost his last 10 matches against Djokovic, including in the semifinals in Madrid previous year.
"One break was enough, 5-4, 6-5, both sets", Djokovic said in his post-match interview.
"Hopefully I can do that with my team, and play better in Rome and Roland Garros".
In the women's draw, third-seeded Simona Halep of Romania defeated 16th-seeded Samantha Stosur of Australia 6-4, 4-6, 6-4.
Halep will play Anastasija Sevastova of Latvia, who defeated Kiki Bertens of the Netherlands 6-3, 6-3. Mladenovic will play eighth-seeded Svetlana Kuznetsova of Russian Federation, who easily defeated Canadian Eugenie Bouchard 6-4, 6-0.