Ferrer finished his 20-year career with 27 singles titles; fifth-best among active players behind the top four of Roger Federer, Rafael Nadal, Novak Djokovic and Andy Murray.
The curtain came down on David Ferrer's career after defeat by reigning champion Alexander Zverev at the Madrid Open.
The 37-year-old Spaniard, a former world No 3 who won 27 career titles and reached the French Open final in 2013, wanted to retire after his home tournament.
Ferrer had beaten compatriot Roberto Bautista Agut on Tuesday to prolong his career by 24 hours, and threatened to extend it further after racing into a 4-1 lead in the first set against Zverev.
But that was as good as it got for the veteran as 22-year-old German Zverev, the third seed, dropped just one more game on his way to a 6-4 6-1 victory.
"I'll never forget this day," he said, with his wife and son by his side. "I've been very lucky. I've always wanted to end my career like this.
I couldn't keep playing at the level that I wanted, but I'm very happy and very proud of my career."
Alexander Zverev embraces Ferrer of Spain at the net
"All the players are very sad he is retiring," Zverev said. "You always left everything on the court, in every single match. It's a privilege for me to be here playing against you in your last match."
Ferrer had 733 wins in 1,111 matches, fourth-best among active players.