"I am very tired. I had to run a lot," Ferrer said after the match.
"I am happy for myself, it is a very special night for me but I am sorry for my friend Rafa.
"In the tough moments he plays very well."
For Nadal, who has been troubled by a knee injury throughout the tournament, it was another US Open disappointment as he has failed to get any further than the quarter-finals in his five appearances at the season-ending Slam so far.
"He is a very good player, one of the best players in the world right now," Nadal said.
When asked how much his injury had affected his performance, Nadal shook his head.
"I don't want to speak about my body right now," he said. "I have been speaking about that all week and it would sound like an excuse and there is no excuse.
"He played very good and he beat me. Maybe another day we can speak about the injuries."
"I am happy for myself, it is a very special night for me but I am sorry for my friend Rafa."
David Ferrer, US Open 15th seed
The last round of 16 match in the men's draw began at around 10pm on Tuesday night, with the crowd knowing they were in for the long haul after the first two sets were shared in just under two hours.
Ferrer was in control of most of the rallies against a tentative-looking Nadal and it was no surprise when the underdog took the all-important third set 7-4 in a tie break.
Sensing an upset, the 25-year-old kept up the pressure as a struggling Nadal required treatment on his knee tendons, and for cramps in his dominant left hand.
Ferrer then broke early in the fourth set to lead 4-2, held for 5-2 and then broke the 20-year-old Nadal once again to take the match and leave the bottom half of the draw looking like an easier path for third seed Novak Djokovic.
Djokovic takes his time
However the 20-year-old Serb had troubles of his own in his fourth round encounter, having to fight hard to overcome Argentina's Juan Monaco 7-5, 7-6, 6-7, 6-1 in a gruelling match that lasted just under four hours.
Serbia's Novak Djokovic has spent a great deal
of time on court at Flushing Meadows [EPA]
Djokovic needed four hours and 44 minutes to defeat Radek Stepanek in the second round, and risks being physically drained going into a quarter-final match-up with evergreen Spaniard Carlos Moya.
"I had soreness in my back and had to call the trainer. Then I had a little pain in my stomach and I felt out of energy also. I had some pills and vitamins so after that I felt pretty good," Djokovic said.
"It's good that I have a day off and can recover."
Moya, the oldest man left in the tournament at 31 years of age, showed all his experience to outclass Latvian newcomer Ernests Gulbis 7-5, 6-2, 6-7, 6-4 to reach the quarters in New York for the first time since 1998.
"I feel like 20 years old the way I'm playing. It's great," Moya said.
"When you're the oldest guy in the draw you get a lot of support from the crowd."
Chela into quarters
Meanwhile, 28-year-old Chela reached the last eight of a Grand Slam event for just the second time in his career with a five-set 4-6, 6-2, 7-6, 1-6, 6-3 win over Stanislas Wawrinka of Switzerland after being one set down.
"It is my first time in the quarters here and the second time in my career so this is great for me. It's been a very good year," Chela said ahead of his meeting with Ferrer.
"I'm tired now, but I have a day off and I will be okay for the semis."