The midfielder is returning to the Bundesliga and his old side, with whom he reached the Champions League final in 2002
"With my transfer to Bayer Leverkusen a circle is complete. I had a beautiful and successful time here, on which I like to look back on a lot," Ballack said on www.bayer04.de.
"That was a factor in my decision."
Ballack added: "But above all the good sporting potential of this young and attractive team were persuasive.
"I am especially looking forward to the great fans, who naturally have been key in my decision to return to Bayer."
Bayer sporting director Rudi Voller is delighted to have signed a player of Ballack's experience, and believes he will help the development of the club's crop of young players.
"With Michael Ballack our team is getting an enormous boost in quality," he said. "Especially our many young players will benefit from his abilities and his experience.
"We did everything to convince Michael. That his preference was for Bayer despite our limited financial possibilities in comparison to the competition, shows his emotional attachment to the club."