The coach, who first made his decision public in a newspaper interview last week, told a news conference that he would be stepping down after four years at the club and had informed chief executive Adriano Galliani.
"I spoke to Galliani prior to Christmas about the decision to leave in June," he said. "It's only in Italy where all the fuss is made. Yesterday [Saturday] Bayern Munich announced the arrival of [Robert] Lewandowski from a rival team [Borussia Dortmund] and that should become normal in Italy as well.
"We're professional and we have to work well to the end of the contract. I've had four years here and I thank [club] president Berlusconi, Adriano Galliani and the club for giving me the chance to lead an important team."
Milan, who host Atalanta today, have won only four league games this season and are a modest 13th in Serie A with 19 points from 17 games.
Allegri also referred to speculation that former Milan and Netherlands midfielder Clarence Seedorf, currently in Brazil with Botafogo, could replace him. "The club will find the right person to take my place, someone worthy of the club. Seedorf is a very intelligent player. Coaching is a different trade but I know the club will choose someone able to get the results that they expect."
Allegri took over in 2010 and led Milan to the Serie A title in his first season and second place the following year. The club then sold off several top players including Zlatan Ibrahimovic during the summer of 2012 and put the emphasis on youth.
Milan staggered into third place last season but, plagued by injuries, have done worse this term and look out of contention for a Champions League place.
Despite their poor domestic form, Milan are the only Italian survivors in this season's Champions League and face Atletico Madrid in the first knockout round. "I want to finish my time here the best way possible," he said. "I think we've a good chance of getting to the next round."