(CNN) -- World number one Rafael Nadal was taken to a deciding third set by Bulgarian teenager Grigor Dimitrov before reaching the quarterfinals of the ATP tournament in Rotterdam.
Nadal was relieved to see off the determined challenge of Bulgaria's Dimitrov.
Australian Open champion Nadal eventually prevailed 7-5 3-6 6-2 against the 17-year-old Dimitrov, who is the junior Wimbledon and U.S. Open champion.
Nadal, playing his first tournament since beating Roger Federer in a classic Melbourne final, has struggled to adapt to the fast indoor surface at the ABN-Amro event and it showed against Dimitrov.
After taking the first set, Nadal was broken in the eighth game of the second set as Dimitrov drew level.
Nadal quickly took control of the decider to earn a last eight clash with French star Jo-Wilfried Tsonga, who beat Dmitry Tursunov of Russia 7-6 6-2.
Tsonga, who won the ATP tournament in Johannesburg at the weekend, was untroubled after claiming a tight first set on a tiebreaker.
Earlier, second seed Andy Murray was far from his best as he struggled to beat Italian Andreas Seppi, who had beaten Nadal in Rotterdam last year.
He posed an out-of-sorts Murray plenty of problems before the Briton finally sealed a 7-6 7-5 victory.
Murray took a topsy-turvy first set on a tie-break and then battled back from a break down to seal a meeting with Frenchman Marc Gicquel in the last eight of the tournament.
Gicquel secured his place in the last eight after defeating compatriot Paul-Henri Mathieu 6-4 6-3.
Another Frenchman, fifth seed Gael Monfils, put out compatriot and defending champion Michael Llodra 6-4 6-4, and will tackle compatriot Julien Benneteau -- who booked his last-eight place on Wednesday with an upset win over Russian third seed Nikolay Davydenko.
Meanwhile, Croatia's Mario Ancic continued his recent run of good form with a 6-4 3-6 6-3 win over French fourth seed Gilles Simon. Ancic next faces Russian Mikhail Youzhny.