Ripping big groundstrokes off both wings, many on a full sprint, Nadal and Fognini engaged in entertaining exchanges that thrilled the Arthur Ashe Stadium crowd until nearly 1:30 a.m. ET Saturday, 3 hours, 45 minutes after they began.
"To win like that -- against him, from two sets down -- is something incredible,'' Fognini said, calling it a "mental victory.''
Nadal, the No. 8 seed, also saw his 10-year streak of winning at least one major title per season end. He lost in the quarterfinals at the Australian Open and the French Open, then the second round at Wimbledon.
"The only thing it means,'' Nadal said about that streak coming to a close, "is I played amazing the last 10 years.''
Nadal, who has won two of his 14 career major titles at Flushing Meadows, not only claimed the first two sets against Fognini, but also led by a break in the third at 3-1.
He couldn't sustain it, though. Fognini began taking more high-risk shots and putting plenty right where he wanted them, winding up with more than twice as many winners as Nadal, 70 to 30.
The fifth set, which lasted 52 minutes, was filled with one apparent momentum swing after another. Starting at 1-all, there were seven consecutive breaks of serve, a pattern that finally ended when Fognini broke to go ahead 5-4, then held to end it.
"Well, I was starting to feel the ball really good, believe me," Fognini said. "I lost that first set 6-3, but I was say in my mind, OK, let's try, let's keeping working; do your tennis.
"I went down a break. After come back on 4-4, I went 40-love on that game and I lost [an] incredible game. So was my fault. Even if I come back from a break down, I say, 'OK, let's try.' But two sets to zero against Rafa, maybe you have to go to Lourdes.
"I went there tonight and everything was in a perfect way."
Asked how it was possible that an opponent could produce that many winners against him (70), Nadal smiled and joked: "Maybe I am slower.''
"He played great," Nadal said. "It was not a match that I lost, even if I had opportunities. It's a match that he wins.
"So accept. Not happy that he played better than me, but that's what happened. He played better than me, no? I didn't play bad at all. I played a normal match, but not enough."
Nadal had won 22 of his previous 23 US Open matches, including earning titles in 2010 and 2013 and reaching the final in 2011. He missed the tournament because of health issues in 2012 and last year.
Fognini reached the fourth round at Flushing Meadows for the first time in eight appearances. The last Italian man to get that far at the US Open was Davide Sanguinetti a decade ago.
Nadal said he felt he was more focused during this tournament than in previous stretches of this season.
"For the nerves, for the [anxiety] that I had for a long time this season, I was not able to do it. I was not able to be fighting the way that I was fighting today. So it is an improvement for me. I take that like a positive thing and I know what I have to do. [I'm] going to work on it."
The Associated Press contributed to this report.
Fognini rallies from two sets down to beat Nadal
Fabio Fognini beats Rafael Nadal in five sets to hand Nadal his first career loss at a Grand Slam after winning the first two sets.