Ferrer beat Philipp Kohlschreiber 7-6 (7-1) 3-6 7-6 (7-4) 4-6 7-5 in the deciding rubber in Valencia.
"It's great to be back even if after an injury it's always hard".
The Spaniard is now perched on world number thirty three, and is scheduled to play the Davis cup tie featuring Spain and Germany this week.
The victory gave Nadal, the world No 1, the longest Davis Cup winning streak in combined singles and doubles rubbers, with 23 matches in a row.
ITALY 1, FRANCE 3 Venue: Valletta Cambiaso ASD, Genoa, ITA (clay - outdoor) Lucas Pouille came from a set down to send France into the semi-finals, defeating Fabio Fognini 2-6, 6-1, 7-6 (3), 6-3. "I won without playing my best tennis, those are the best types of victories", Pouille said after his first Davis Cup win over a top-20 player.
Ivan Dodig and Nikola Mektic overcame Kazakhstan's Timur Khabibulin and Aleksandr Nedovyesov 6-7 (2) 6-4 6-4 6-2 to hand Croatia a 2-1 lead.
Nadal's appearance for Spain in the Davis Cup will be followed by his return to the ATP Tour at the Monte Carlo Masters, which signals the beginning of the clay court swing of the season.
"I am really pleased with the workforce and I am quite relieved as the previous game was so close", France captain Yannick Noah informed your rivalry's official website.
The United States begin their quarter-final against Belgium later on Friday, with John Isner set to face Joris De Loore and Sam Querrey taking on Ruben Bemelmans in Nashville, Tennessee. Nadal has been part of four Davis Cup winning teams thus far and is keen to help his team progress to the last four.
But Mikhail Kukushkin, the top-ranked Kazakh player at 92, then levelled the tie by seeing off world 28 Borna Coric, 3-6, 7-6, 6-4, 6-2.
The heavily-favored US team took a 2-0 lead against a depleted Belgium side on the indoor hard courts in Nashville, Tenn., to come within a point of its first Davis Cup semifinals in six years.
Croatia, the 2005 champions, got off to a winning start against Kazakhstan in Varazdin when world No 3 Marin Cilic outclassed Dmitry Popko, the world No 258, in straight sets, 6-2, 6-1, 6-2.