The 22-year-old Bulgarian lost the opener 6-2 but rallied to take the next two 6-3 6-4, ending the Spaniard's dreams of a third title this year.
He had to beat off two break points in the final set before going on to seal victory in the indoor hard-court tournament.
"Even if I would have lost the match, the most important thing was to test myself to the limits and try to control what I can," he told the ATP website. "This was icing on the cake."
Dimitrov won the boys titles at Wimbledon and the US Open in 2008.