Allegri had already been told he would be replaced at the end of the season but that decision was brought forward after Milan threw away a 2-0 lead to lose 4-3 on Sunday, Domenico Berardi scoring four goals for Sassuolo, a team Allegri used to coach.
The loss was the latest in a series of poor results that have seen Milan fall well short of the pace in Serie A - they have only won four games all season and are currently 30 points behind leaders Juventus, just six points clear of the releagtion places.
A brief statement on the AC Milan website read: "AC Milan announce they have dismissed Mr. Massimiliano Allegri and his staff.
"AC Milan would like to thank Mr. Allegri and his staff for the work done and wishes them success."
Allegri's departure brings to an end a three-and-a-half-year spell in charge of Milan that saw them win the Italian league title in 2011.
Former player Mauro Tassotti, part of the coaching staff at San Siro, will take interim charge of the first team although another ex-player, Filippo Inzaghi - currently coaching the club's Primavera (U19) side - is the favourite to take charge on a permanent basis.