The fourth-seeded Nadal posted a 7-6 (8), 6-4 victory over the eighth-seeded Thiem to win his third straight ATP Tour event. He has a 15-0 match record on clay courts this season.
It marks the fifth time Nadal has won the crown in the capital city of Spain. It also is his 30th career ATP Masters title, tying Novak Djokovic for first place.
Nadal's current title streak began with victories at Monte Carlo and Barcelona last month. He also beat Thiem in the Barcelona title match.
Nadal had to fight off Thiem to win a tiebreak in the opening set and faced a strong push by Thiem late in the second set.
Nadal led 5-3 and had double match point before Thiem won four consecutive points to win the game. Thiem again responded with a fierce battle with Nadal serving for the match but the Spaniard finally put him away with a forehead winner to end the 2-hour, 18-minute match.