The striker has signed a five-year deal with the Italian champions, though los Blancos will retain a buyback option of up to 30 million euro for the player.
Morata arrived in Turin on Friday ahead of a medical with the Italian champions after weeks of speculation about a possible summer switch.
Juve now has confirmed the 21-year-old has agreed to a five-year deal, and also has revealed that Madrid will retain a buy-back option in the player's contract that could rise to €30m.
"Juventus announces that it has reached an agreement with Real Madrid for the definitive purchase of the rights to the player Alvaro Borja Morata Martin for a fee of €20m, payable over three years," a statement on their official website read. "The agreement also provides an option for Real Madrid, exercisable at the end of the 2015-16 season or 2016-17 season, for the outright repurchase of Morata, up to a maximum of €30m depending on the number of games the player has played for Juventus.
"Juventus have signed a five-year contract of employment with the same player."
Morata scored eight goals in 23 Liga appearances for Madrid last season and had earlier spoken of his excitement to start "a new adventure" with Juventus.
He becomes the second player involved in a transfer away from Madrid on the same day, with midfielder Casemiro's loan move to Porto also confirmed on Saturday.