Niang, 17, had been linked with the likes of Arsenal and Everton this summer after impressing in Ligue 1 for relegated Caen.
But Milan have signed the France youth international on a three-year contract for an undisclosed fee, understood to be in the region of £2 million plus add-ons dependent on a tribunal.
"Stade Malherbe Caen would like to thank M'Baye Niang for what he achieved during the last four years at the club," the French side said on their website.
"The young forward has today signed a three year contract with AC Milan of Serie A. We wish him the best of luck at his new club and in his personal life."
Niang has scored five league goals in two seasons for Caen but is seen as one of the brightest prospects in France.
Milan are also in talks with Roma over a loan deal for Bojan after Barcelona reportedly waived their option to re-sign the Spain striker.
Bojan, 22, joined Roma from Barca last summer in what was billed as a permanent transfer but was essentially an extended loan deal, with the Catalan giants retaining the right to buy-back the player for set fees at various stages of his contract.
The player impressed in flashes at Roma although his return of seven goals last season was not deemed sufficient by new boss Zdenek Zeman, even if Fabio Borini was sold to Liverpool this summer.
And Roma sporting director Walter Sabatini arrived at Milan’s corporate HQ on Tuesday morning, with Milan chief executive Adriano Galliani confirming talks were at an advanced stage.
"We're moving in the right direction in an attempt to sign Bojan Krkic," Galliani said. "Things should be finalised today."
Bojan is on a two-year contract but Barca have the right to buy him back both this summer and next year.
Reports in Italy claim that Barca have given clubs permission to sign the product of their La Masia academy, with Genoa, Atletico Madrid, Malaga and Hamburg also linked with the once-capped Spain international.