The former No. 1 said differing medical opinions on resolving the lingering right foot injury had provided more stress than solutions and left him with little option but to retire.
"It's not how I dreamt of ending my career," the 34-year-old Moya said during an emotional news conference on Wednesday.
Moya said he knew it was time after his last match, a 6-0, 6-2 loss to Benjamin Becker at the Madrid Masters in May.
"I wanted to play the big tournaments and say goodbye but I got to the Madrid tournament and I still wasn't 100 percent but motivation pushed me on," Moya said. "But I realized with that match that the moment had arrived."
Moya won 20 ATP titles, including the 1998 French Open. He was the first unseeded finalist in 16 years at the 1997 Australian Open, but fell to top-ranked Pete Sampras. His last title came in Croatia in 2007.
He became the first Spaniard to become No. 1 in the rankings in March 1999.
After leading Spain to the 2003 Davis Cup final, he spearheaded the team to the 2004 title, beating Andy Roddick to clinch the final in his last tie.
He was an early training partner of Rafael Nadal. Both hail from the island of Mallorca.
Former players Manolo Santana, Albert Costa and Carlos Costa were all on hand for the announcement.
"I'll keep on with my gym in Mallorca. I have a sports business and I'll dedicate more time to my wife, my daughter and my family (now)," Moya said of his future. "I'll definitely miss tennis, however."