Fourth seed Murray was leading 6-2 1-0 when his unseeded Spanish opponent decided to call it a day.
Murray now faces sixth seed Robin Soderling, who defeated Jo-Wilfried Tsonga in straight sets to reach the last eight.
There were few indications of any physical weakness in world number 40 Almagro at the start of the match as he hit a number of strong winners on his way to forcing an early break of the Murray serve.
The Scot rallied with a break to love in the next before moving firmly into the driving seat with another break.
Almagro won just 33 per cent of points on his own serve in what was a scrappy first set for the Spaniard, who conceded a third break in the eighth to hand Murray a one-set lead.
Almagro called for treatment to his left ankle at the end of the first set and though he battled on Almagro offered his hand after Murray held his serve in the next game.