Andy Murray survived a scare to book his place in the semi-finals of the Qatar Open with a hard-fought victory over Nicolas Almagro.

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 and he struggled to recover from the stuttering start.

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 told Eurosport.

"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."