Nadal, the world No. 1, breezed through the first set without facing a break point, but the 36-year-old Ferrer fought back in the second, breaking Nadal twice before the injury forced him to stop with the score at 6-3, 3-4.
The 2013 French Open runner-up, an apologetic Ferrer - who lost that final to Nadal - confirmed the exit marked his last major appearance.
But at the August 27-September 9 US Open in NY the world number one will not have time to add more moves to his lengthy repertoire as a 25-second clock will tick down immediately after the chair umpire announces the score.
"I have great memories of this tournament and I am just sorry that I couldn't finish it tonight".
Nadal, who had won 24 of his previous 30 meetings with Ferrer, was always a favourite against his fellow Spaniard. Next will be Canadian Vasek Pospisil on Wednesday.
Nadal, as expected, struck first in the third game as a pair of backhands brought up a break point, taken when Ferrer's own backhand found the net to give the world number one a 2-1 lead.
He is a three-time Davis Cup champion (2008, 2009, and 2011). I will try to be there with recovery.
He next faces Denis Kudla of the United States who won his first match in five years at the tournament when he downed Matteo Berrettini of Italy 6-4, 7-5, 6-2.
U.S. hopes were buoyed by wins for 11th seed John Isner and 18th-ranked Jack Sock who won his first singles match since May.
Dressed from head to toe in a plum-colored outfit, the 20-time major champion delivered 14 aces and never was in any trouble during a 6-2, 6-2, 6-4 victory over 117th-ranked Yoshihito Nishioka of Japan at Arthur Ashe Stadium on Tuesday night.
French actor Gerard Depardieu is subject of rape complaint
Paris public prosecutor's office has opened a preliminary inquiry into allegations against Depardieu after a complaint. Actor Gerard Depardieu has been accused of rape and sexual assault by a French actress in her twenties, reports say.
International Space Station leak may have been caused by micrometeorite strike
Another leak occurred in the station's Harmony module (which is located on the USA segment) in 2007 during Expedition 16. Russian officials say the pressure leak was detected Wednesday night and may be the result of a micrometeorite strike.
Barefoot woman filmed ringing doorbell with wrists shackled found safe
Pretty suspicious, right? Montgomery County deputies are investigating the incident, but so far there are no leads. I figure if someone really needs to get in touch with me, they'll be persistent at the door or give me a call.
Defending champion Sloane Stephens is into the second round of the U.S. Open.
Australian bad boy Nick Kyrgios will play the first match of the evening session at the Louis Armstrong Stadium against Moldovian Radu Albot while Maria Sharapova, who is seeded 22nd this year, faces Switzerland's Patty Schnyder.
Former world number three Ferrer, who now stands at a lowly 148, beat Nadal when they met in NY in 2007.
Like Murray, former champion Stan Wawrinka also sat out the 2017 US Open - in his case because of two knee surgeries. Nicki Minaj collaborated with the 23-time Grand Slam champion and Beats to release a special "Queen of Queens" video, set to her song "Majesty".
Dominic Thiem, Jack Sock, John Isner and Milos Raonic were also winners.
Djokovic, who has found similar conditions hard in the past, said: "We obviously both struggled".
Perhaps aware he needed to finish the match quickly, the sixth seed destroyed a racket after failing to break the Fucsovics serve for 3-2 in the second set, and the Hungarian won the next two games as well. We played important matches for both of us.
It was a tough one, until he dominated after players were allowed to leave the court for 10 minutes following the third and fourth sets.