Federer will therefore move back to the top of the rankings, despite taking the clay-court season off, but of more effect is a performance from Thiem that suggests Nadal may have a genuine rival at the French Open.
The 24-year-old Thiem broke Madrid title-holder Nadal's serve five times before sealing victory with a powerful cross-court victor in just under two hours.
Rafael Nadal won his 50th consecutive set on clay on Thursday to break John McEnroe's 34-year record and beat Diego Schwartzman at the Madrid Open.
Dominic Thiem from Austria celebrates his victory over Rafael Nadal from Spain during a Madrid Open tennis tournament match in Madrid, Spain, Friday, May 11, 2018.
Next up for Thiem is Kevin Anderson, who is a hard-to-believe 6-0 in the head-to-head series and 13-2 in total sets.
A couple of mistimed forehands from Nadal handed Thiem an early 3-1 advantage in the second set but the defending champion fought back to draw level after six games.
"It takes a really good match to beat Rafa on clay". "It takes a really good match to beat Rafa on clay, but I think a very important thing was that I went in with the attitude that I can beat him".More news: Bill Gates reveals himself as one of Bitcoin's harshest critics
More news: Ukraine's MELOVIN to open Eurovision 2018 Grand Final
More news: Thanos Lands in Fortnite, Gets Nerfed Immediately
"Two weeks ago in Monte Carlo, he killed me love and two". It was very important I went into the match with a positive attitude-with an attitude to win. "I should go into every match like this against him".
Nadal's comfortable 6-3, 6-4 victory moves him into the quarter-finals in the Spanish capital and means he sets a new Open era best for the longest streak of victorious sets on a single surface.
Anderson, the 31-year-old US Open runner-up last year, hit 15 aces and 35 winners.
Kvitova will meet Kiki Bertens in the final after she beat seventh-seeded Caroline Garcia 6-2, 6-2.
Thiem unsettled Nadal from the start, breaking his serve twice in the first set.
Kyle Edmund followed up his win over Novak Djokovic by toppling eighth seed David Goffin 6-3 6-3, while Alexander Zverev eased to a straight-sets success over Leonardo Mayer.
On the women's side, two-time former Madrid champion Petra Kvitova beat Karolina Pliskova 7-6 (4), 6-3, in an all-Czech semifinal.