The Bianconeri were keen to clear space in their squad and raise funds ahead of their approach for Fiorentina star Federico Chiesa and coach Andrea Pirlo saw Costa as surplus to requirements.
It has allowed Champions League winners Bayern Munich to seal a season-long loan for the winger, who returns to the Bundesliga club following a successful spell from 2015 to 2017.
Bayern Munich took to their official website to announce the signing of Costa, who had won the Bundesliga in both of his seasons at the club, prior to joining Juventus.
The 30-year-old enjoyed a fruitful spell in Serie A with the Bianconeri and won the Scudetto three times, as well as the Coppa Italia.
His 103 appearances for Juventus saw him score 10 goals, after initially arriving from Bayern Munich on loan in 2017.