The world number one began slowly in Doha and appeared frustrated for much of the match as he battled to a 7-6 (7/4), 7-5 success over the unseeded Spaniard.
It was the first time the pair had faced each other in almost three years and Murray’s only defeat in five matches against the current world number 44 had come at the 2008 French Open, when they met for the first time.
Despite those statistics and being a strong favourite for this one, the Scot was broken in the first game after dropping his first four service points.
He struggled to recover from that stuttering start but the next six games went with serve, although Murray squandered three break points in the fourth, before he eventually levelled at 4-4.
He finally wrapped up the opening set after being taken to a tie-break, but Almagro’s resistance showed little sign of being broken.
The 31-year-old was clearly enjoying the challenge of taking on a superior opponent, much to the detriment of Murray who, after securing an early break in the second set, immediately surrendered the initiative as he served a double fault to lose the next game.
The set then followed a similar pattern to the first, with both players holding serve until Murray made a crucial breakthrough in the 11th game.
It took him 14 points to do so as Almagro once again dug in to save two potential breaks before eventually succumbing, and Murray, who won the competition in 2008 and 2009, then saw out the following game to seal his place in the last four.
“It was a tough match today, very close both sets, obviously,” Murray said.
“Nico was playing very aggressive, going for his shots and it was hard conditions tonight. It was very windy so it was tough to get into much of a rhythm. “I served pretty good; second serve points won was where the difference was in the match. I won 61 per cent of mine, I think he won 48 per cent of his, so that was the difference.”
Murray will face Tomas Berdych in the semi-finals after
the Czech third seed needed just over an hour and a half to see off Frenchman Jo-Wilfried Tsonga 7-5, 6-3. He will now look to beat Murray for the first time in seven meetings.
World No 2 Novak Djokovic will play Fernando Verdasco in the other semi-final after cruising past veteran qualifier Radek Stepanek.
The Serb won 6-3, 6-3 against 38-year-old Czech Stepanek, while Spaniard Verdasco also came through in straight sets, defeating Croatian sixth seed Ivo Karlovic 6-2, 7-5.
Fourteen-time grand slam winner Rafael Nadal will face top seed Milos Raonic in the last eight of the Brisbane International following an emphatic win over Mischa Zverev. The Spaniard dropped just 24 points as he sealed a 6-1 6-1 victory over the German inside 56 minutes.
Canadian Raonic also had little trouble progressing, seeing off Argentinian Diego Schwartzman 6-2, 6-4.
In the other quarter-final in the top half of the draw, Dominic Thiem will meet Grigor Dimitrov.
Austrian Thiem came through a first-set tie-break to eventually beat Australian Sam Groth 7-6 (7/5), 6-3, while Bulgarian Dimitrov was a 6-2 6-4 victor against Nicolas Mahut.
Aljaz Bedene survived a three-hour tussle with Martin Klizan to reach the quarter-finals of the Chennai Open.
The British No 4 has an excellent record at the Indian tournament having never failed to make the last eight in five visits. He reached the final as a qualifier two years ago and pulled off another impressive result against fourth seed Klizan.
It needed a huge effort from the Slovenian-turned-Briton, ranked 101, as he prevailed 7-6 (7/3), 6-7 (2/7), 7-6 (7/2) after three hours and four minutes.
Bedene must recover quickly for a clash with French fifth seed Benoit Paire today.