Nadal has played three tournaments this year and has not reached a final. He lost in the quarterfinals of the Australian Open, was beaten in the first round of the Qatar Open, and is now out of Rio, on his preferred clay surface, in a tournament he won last year.
He also won on clay two years ago in Chile on the Latin American swing.
"Everybody knows he (Nadal) is the best on this surface," Fognini said. "I don't have words to describe this moment. I am super happy. It's the best match I have won so far in my career."
Nadal will play next week in Buenos Aires, hoping to rebound with an eye on the French Open three months away. He has won nine of the past 10 title at Roland Garros, but this time may be his biggest challenge.
"I feel my tennis is close, closer than a month ago to the level I want to arrive again," said Nadal, who missed much of last year with illness and injury.
Nadal complained of cramps from the Rio heat, and said he simply has not played enough. He said he's motivated, and said Rio "was not a negative week."
However, he hedged if he would be back next year for this tournament. But he said he would be for the Rio Olympics.
Nadal looks much slimmer than a year ago, although he said earlier in the week his weight had stayed the same for six years -- between 188-190 pounds.
"My physical side is about the same as always," he said. "Everything is the same. There are no changes in my life. There are no changes in my preparation."
Fognini won the match by scrambling to the net and scooping a ball -- that had nipped the cord -- back across for the winner.
Nadal won the first set easily but was not able to maintain that level.
"I have to be happy the way I played that first set," Nadal said. "But I got tired too early today. ... But these kinds of things can happen."
Nadal surely was tired. He played until 3:18 on Saturday morning before beating No. 6-seeded Pablo Cuevas. He was back on court just 17 hours later. Fognini also played a late match the night before, but not quite as late as Nadal.
Ferrer progressed to Sunday's final by defeating Andreas Haider-Maurer of Austria 7-5, 6-1. Spain's Ferrer has played Fognini seven times, and won them all.
The final will be in the early evening, but the temperature will still hover around 32C (90F) with stifling humidity.
"At night it's better, but you still sweat a ton," Ferrer said. "The humidity and heat is taking away the energy and spark I have normally."
The women's final will be between top-seeded Sara Errani and No. 6 Anna Schmiedlova of Slovakia. Schmiedlova defeated No. 2 Irina-Camelia Begu of Romania 6-3, 4-6, 6-2, and Errani won over No. 5 Johanna Larsson of Sweden 7-5, 6-3.