Andy Murray survived a scare to book his place in the semi-finals of the Qatar Open with a hard-fought victory over Nicolás Almagro, while Johanna Konta battled to the last four of the Shenzhen Open.

Murray began slowly in Doha and appeared frustrated for much of the match as he battled to a 7-6, 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 No44 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 world No1 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.

Johanna Konta of Britain hits a return against Kristyna Pliskova on the way to a three-set victory. Photograph: STR/AFP/Getty Images

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 breaks before eventually succumbing. Murray, who won the competition in 2008 and 2009, then saw out the following game to line up a meeting with Tomas Berdych, who beat Jo-Wilfried Tsonga 7-5, 6-3.

“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% of mine, I think he won 48% of his, so that was the difference.”

The defending champion, Novak Djokovic, also advanced to the semi-finals by beating the Czech qualifier Radek Stepanek 6-3, 6-3.

Konta is one victory away from her third WTA final after she beat Kristyna Pliskova 6-4, 6-7, 6-3 in the Shenzhen Open quarter-finals in China. Konta will play another Czech, Katerina Siniakova, in the semi-finals.

Aljaz Bedene survived a three-hour tussle with Martin Klizan to reach the quarter-finals of the Chennai Open. It needed a huge effort from the Slovenian-turned-Briton, ranked 101, as he prevailed 7-6, 6-7, 7-6 after three hours and four minutes. Bedene must recover quickly for a match against the fifth seed, Benoît Paire, on Friday.