World No 1 Rafael Nadal scraped through to final of the Rio Open after saving two match points in a 2-6 6-3 7-6 (12-10) win against Pablo Andujar.
Nadal eventually took the spoils in a contest which lasted two hours and 46 minutes to set up a final against unseeded Ukrainian Alexandr Dolgopolov.
Andujar made a bright start and looked set to hand his fellow Spaniard a shock defeat after storming through the first set.
But Nadal showed his fighting spirit to get back into the match, striking 40 winners to remain on course for a 43rd ATP title on clay.
In the other semi-final, second seed David Ferrer was knocked out of the Brazilian event by Dolgopolov.
World No 4 Ferrer was going for back-to-back claycourt titles after winning the Copa Claro in Buenos Aires last week but went down 6-4 6-4 to Ukrainian Dolgopolov, who had won just one of their seven previous meetings.
"I always have these type matches with him, and usually at the end he beats me," Dolgopolov said.
"I knew I'd have to make those shots. If you don't win the points against him, he takes it away. I'm really happy I didn't get tight and give away a lot of shots."