Nadal had racked up 52 straight wins over 12 years to reach title matches, but the battling Fognini ended the streak with a 1-6 6-2 7-5 victory.
He will meet Nadal's fellow Spaniard David Ferrer in Sunday's final.
Nadal, whose 2014 was disrupted by injury and illness after winning a record ninth French Open title, has struggled since his return to action, losing in the first round in Qatar and the quarterfinals of the Australian Open.
But returning to clay in Brazil, the world number three was a firm favorite to repeat his success of last year and had a winning 4-0 record over Fognini going into their last four encounter.
But after cruising to the first set, his opponent adopted a more aggressive approach and forced a deciding set.
Nadal, trailing 5-6 in the third set, finally cracked as Fognini converted his third match point after a stunning rally, closing out victory after two hours 17 minutes.
"I'm really happy about this match," Fognini told the official ATP Tour website.
"I beat the best player on this surface. Rafa is always difficult. From the second set I played really well, and I tried to change a little bit to be more positive on court."
The match finished after midnight Saturday local time and Nadal had been kept on court until 3.30 am in his quarterfinal win over Uruguayan Pablo Cuevas, but he refused to make excuses.
"I have to accept the situation and work to get ready for what's next," he said.
"I'm working well, I have the right attitude, I have to improve things and I think that I'm on the right path and closer to the level of game that I'm looking for."
The 27-year-old Fognini, who had himself been kept on court late Friday night in his last eight clash with Argentine Federico Delbonis, will be bidding for his fifth ATP Tour title, but has never beaten Ferrer in seven previous matches.
Nadal will now head to the ATP clay court event in Buenos Aires, Argentina as he steps up his preparations to win a 10th French Open at Roland Garros later this year.
But his fourth defeat on clay in the course of the year, to Ferrer in Monte Carlo, world number one Novak Djokovic in Rome and Nicolas Almagro in Barcelona were the others, leaves question marks over Nadal's bid to make further history.
In other ATP Tour action, fifth seed Gilles Simon beat French compatriot Gael Monfils 6-4 1-6 7-6 Sunday to win the title in Marseille.
It was the 12th career title for the 30-year-old Simon, while seventh seed Monfils slipped to 5-17 in finals.
On the WTA Tour, Simona Halep of Romania beat the Czech Republic's Karolina Pliskova 6-4 7-6 in the final of the Dubai Championships.
It was her 10th career title and will lift Halep to third in the world rankings behind Serena Williams and Maria Sharapova.
Halep eventually prevailed after a marathon second set lasting over an hour, wasting two match points as she served for the match at 5-4 and 6-5, before edging the tiebreaker.