Nicolas Almagro overcame a number of wobbles to beat Pablo Carreno Busta and claim his first ATP title in four years at the Estoril Open.
Almagro, whose last success at tour level came in May 2012 when he triumphed in Nice, gained the upper hand in Sunday's all-Spanish final on a number of occasions, only to then give up the initiative.
However, Carreno Busta was unable to capitalise on his opponent's generosity, Almagro eventually prevailing 6-7 (6-8) 7-6 (7-5) 6-3 to end his drought.
Carreno Busta pinched the first set despite being on the back foot throughout.
Clay-court specialist Almagro initially broke for a 3-2 lead, but spurned three opportunities to win Carreno Busta's next service game and then failed on two occasions to serve out the set - either side of another break of serve.
Remarkably, Almagro - who knocked out Nick Kyrgios in the last four - then threw away a 6-2 advantage in the subsequent tie-break by losing six points in succession.
Another chance was missed when the world number 71 moved 5-3 up in set two, before faltering again.
However, Almagro came through the second breaker and finally held on to a lead in the decider as he landed his 13th ATP title.