Juventus have signed Brazilian winger Douglas Costa from Bayern Munich on a permanent deal after a successful loan spell, the Italian champions said on Thursday.

Costa has agreed a four-year contract with Juventus after they triggered the option to buy the player from Bayern for a fee of 40 million euros ($47.2 million) to be paid over two years.

The 27-year-old scored six goals in 47 competitive appearances during his season-long loan with Juventus, helping them to win the Serie A title and Coppa Italia.

Costa proved to be one of the most creative players in the Italian league, also providing 14 assists.