The 28-year-old had been linked to a number of clubs across Europe following a prolific eight-year spell with Shakhtar but it is Milan who have won the race for his signature.
The club said on their official website: “AC Milan announces that it has today acquired Luiz Adriano from FC Shakhtar Donetsk, with the player signing a contract until June 2020. The player will join the team in the coming days.”
Luiz Adriano has won four caps for Brazil and is set to feature in a new-look strikeforce at Milan next season, with the Serie A giants also having agreed a deal to sign Colombia forward Carlos Bacca from Sevilla.
Milan are looking to strengthen their squad after two disappointing campaigns.
The Rossoneri finished 10th in Serie A last season and will miss out again on European football after finishing eighth the previous year.
As a result, Milan sacked coach Filippo Inzaghi and appointed former Sampdoria boss Sinisa Mihajlovic as his replacement.