Langishing in 11th place — six points above the relegation zone — Milan announced the move on its website.
Former Milan players Clarence Seedorf and Filippo Inzaghi were reportedly the leading candidates to replace Allegri on a full-time basis. The 37-year-old Seedorf is currently playing for Botafogo in Brazil while the 40-year-old Inzaghi is coaching Milan's youth squad.
Seedorf has an escape clause in his contract that would let him leave Botafogo without any penalty as long as he doesn't play for another club.
Milan has won only five of 19 matches this season and Allegri had already announced over the winter break that he would leave at the end of the season. But the loss to Sassuolo, which got four goals from teenage forward Domenico Berardi, hastened his departure.
The Sassuolo game marked the debut of recently signed forward Keisuke Honda, and Milan was hoping that the Japan international would lead the squad to a second-half surge the way Mario Balotelli did last season.
But as soon as the match ended, Milan general manager Barbara Berlusconi said the loss highlighted the need for urgent change.
Allegri took over Milan in 2010 and won Serie A in his first season then finished second and third the past two years. Still, he never became a favourite of club owner Silvio Berlusconi.
The only other trophy Allegri won with Milan was the 2011 Italian Super Cup.
However, Milan was the only Italian club to reach the knockout stage of this season's Champions League, and will face Atletico Madrid next month.
The 53-year-old Tassotti is a long-time Milan assistant who had a 17-year playing career with the club.
Milan's next match is against Serie B side Spezia on Wednesday in the Italian Cup. Then on Sunday, the Rossoneri face fifth-place Hellas Verona. Both matches are at the San Siro.
There has also been speculation that Milan would like to sign Italy coach Cesare Prandelli, whose contract with the national team expires after this year's World Cup.
Allegri's contract was due to expire at the end of this season.
It's the seventh coaching change in Serie A this season. The other coaches fired were Fabio Liverani (Genoa), Rolando Maran (Catania), Delio Rossi (Sampdoria), Giuseppe Sannino (Chievo Verona), Vladimir Petkovic (Lazio) and Stefano Pioli (Bologna).
An eighth manager, Davide Nicola, was fired by Livorno later Monday.