Andy Murray was forced to battle hard before booking his place in the third round of the World Tennis tournament in Rotterdam.
The world No 6 came up against stubborn qualifier Dominic Thiem of Austria and had to dig out a 6-4 3-6 6-3 victory.
It had looked as though it would be easy for Murray, with the Scot breaking in the first and third games to take early control.
The signs of trouble became evident quickly, though, and after seeing off a break point he coughed up his serve with a wayward forehand.
He eventually took the set 6-4 but the second must rank as one of the worst Murray has played for some time.
He was never able to dominate his opponent and on his only chance to break in the fifth game, broke a string on the vital point.
He was broken in the eighth game with another poor forehand costing him, and world No 113 Thiem made him pay with a routine hold.
Murray continued to labour in the third set and endured a frustrating second game as he repeatedly failed to put Thiem away.
He smashed his racket into his shoe at one stage, before eventually getting the break he craved and going on to see it out.
"It was an unbelievably tough battle," said the Scot, who next plays Marin Cilic. "There were a lot of long points. He was hitting some huge shots, going for the lines.
"He had some really big winners. His game is fun to watch but it's no fun to play against at all. I'm sure we will be seeing a lot more of him."
Top seed Juan Martin del Potro defeated Frenchman Paul-Henri Mathieu 6-2 7-6 in a tough match. The Argentine was forced to save two set points to force a tie-break, which he won 7-2.
Third seed Tomas Berdych saved all four break points he faced in his 6-4 6-3 win over Nicolas Mahut, while Jerzy Janowicz smashed 18 aces past Germany's Tommy Haas to win 6-4 6-4.
Phillip Kohlschreiber converted four break points to upset fourth seed Richard Gasquet 7-5 7-5 in just over 90 minutes and Ernests Gulbis was too much to handle for Grigor Dimitrov, defeating him 6-4 7-6.