Rafael Nadal's extraordinary 2017 continued as he beat Dominic Thiem 7-6 (10-8) 6-4 to claim the Madrid Open title for the fifth time.
The 'king of clay' is unbeaten on his favourite surface this year, and took his record to 15-0, as he added to the titles he has recently collected in Monte Carlo and Barcelona.
But the fourth-seeded Spaniard was given a thorough examination by Thiem, who played a full part in a classy final packed with fine shot-making.
Thiem is still in the early stages of what promises to be a superb career and the Austrian held sway early on, unleashing a string of punishing ground strokes to break the Nadal serve.
But the Spaniard broke back for 3-3 in typically gutsy fashion, winning an epic rally to set up break point and converting when Thiem netted a volley.
Nadal went on to go 40-0 up when Thiem served at 5-6 but the Austrian reeled off a string of scintillating winners and saved all three set points.
That set for the stage for a thrilling tie-break, in which Nadal led 5-3 before losing his way, only to recover and save a pair of Thiem set points.
Both players were producing some brilliant winners but Nadal eventually took the breaker 10-8 when Thiem's usually trusty forehand flew just long to end a set which had lasted almost an hour and a half.
That felt like a critical moment and Nadal went on to break in the first game of the second set, before backing it up by holding for 2-0 after a lengthy game.
Thiem continued to fight bravely and, facing two match points when he served at 3-5, he conjured up some of his best tennis of the match to hold.
He continued his resurgence in the next game and forced four break-back opportunities but Nadal, not renowned as a huge server, came up with some big ones when it mattered.
And, having set up a fourth match point, the 30-year-old steered a backhand volley away for a winner, before sinking to his knees in delight.
A 14-time Grand Slam champion, Nadal is now strong favourite to collect a 10th French Open crown next month, and this victory also moves him above Roger Federer to fourth in the world rankings.
He had landed a first win over Novak Djokovic for three years on Saturdayand has now equalled Djokovic's record of 30 Masters Series titles.
Nadal told Television Espanola: "The truth is I was up against an opponent who, in the next five to 10 years, will be fighting for the most important titles, so I'm very happy to have won.
"It was a very exciting game.
"It was a very important final for both of us, for him as it was the first in the Masters 1000, and for me it's always special to play here in Madrid, in this unique tournament.
"You never know when it might be the last, so I always try to enjoy it."