Rafael Nadal's quest for a ninth Barcelona Open title failed as the world number one slipped to a quarter-final defeat at the hands of fellow Spaniard Nicolas Almagro and saw his 11-year, 41-match unbeaten streak in the city come to an end.

Beaten in last year's decider, Almagro looked destined to be heading home early this year as Nadal showed his class to take the opening set emphatically.

But the eighth seed powered back against his compatriot and levelled the match with a tie-break success.

That took the match into a decisive third set, with Nadal taking the advantage and looking on course to continue his fine form on the clay in Barcelona.

But, having opened up a 3-1 lead, Nadal could not push on to see off Almagro who battled back into the set and sealed a memorable comeback win by overhauling the world's top-ranked player 2-6 7-6 (7/5) 6-4.

Nadal also suffered a quarter-final defeat last week in Monte Carlo, losing to David Ferrer, suggesting he is a long way from prime clay-court form ahead of the French Open next month.

Almagro will next face Santiago Giraldo after the Colombian progressed when his quarter-final opponent Philipp Kohlschreiber retired during the second set.

Giraldo had taken the first set 6-4 and was 4-3 up in the second before German Kohlschreiber called time on hi tournament and the 26-year-old now takes on Nadal's conqueror for a place in the final.

The other spot in the final will be taken by either Kei Nishikori or Ernests Gulbis after both top-10 seeds advanced to the final four in straight sets.

Fourth seed Nishikori needed a little over an hour and 10 minutes to see off Marin Cilic 6-1 6-3 while Gulbis, the ninth seed, beat Russia's Teymuraz Gabashvili 6-1 6-4.