The king told Spaniards in a nationwide address that he first started thinking seriously about giving up the throne when he turned 76 in January.
He said today that the 46-year-old Crown Prince Felipe is ready for the post and will "open a new era of hope combining his acquired experience and the drive of a new generation."
The abdication was first announced by Prime Minister Mariano Rajoy, who did not say when the handover would happen because the government must now craft a law creating a legal mechanism for the abdication and for Felipe's assumption of power.
His longstanding popularity took a big blow following royal scandals, including an elephant-shooting trip he took in the middle of Spain's financial crisis during which he broke his right hip and had to be flown from Botswana back to Spain aboard a private jet for medical treatment.
Also Read
The king's image was also tarnished by the investigation of his son-in-law, who is suspected of embezzling large amounts in public contracts.
In his speech the king did not mention any of the scandals, and played down his health issues.
Felipe would presumably take the title King Felipe IV. He has a law degree from Madrid's Autonomous University and obtained a masters in international relations from Georgetown University in the United States.
Felipe is married to Princess Letizia, a former television journalist, and they have two daughters.
King Juan Carlos came to power in 1975, two days after the death of longtime dictator Francisco Franco. He endeared himself to many Spaniards, in large part by putting down an attempted military coup in 1981 when he was a young and largely untested head of state.
As Spain's new democracy matured over the years and Spain transformed itself from a European economic laggard into the continent's fourth largest economy, the king played a largely figurehead role, travelling the globe as an ambassador for the country. He was also a stabilising force in a country with restive, independence-minded regions such as the Basque region and Catalonia.