The Turin-based club have suffered an alarming dip in form in recent weeks, suffering heavy losses along the way.
Torino lost 7-0 at home to Atalanta in Serie A two weeks ago before exiting the Coppa Italia last midweek after a 4-2 defeat at AC Milan.
Il Toro then compounded their streak of heavy losses with a 4-0 defeat to relegation-threatened Lecce on Sunday.
The club’s hierarchy have decided a change of management is needed to get them back on track and climb up the table from their current 12th position.
'President Ubrano Cairo and coach Walter Mazzarri, after a thorough analysis of the current situation, have decided to end their professional relationship,' a club statement read on Tuesday.
'Torino Football Club announces therefore the consensual resolution of Walter Mazzarri's contract.
'The club wishes to thank the coach and all of his staff for the commitment, fairness, and professionalism shown in these last two years.'
Mazzarri joined Torino in January 2018 and guided the club to seventh place in his first full season in charge, earning a place in the qualifying rounds of the Europa League, where they were eliminated by Wolverhampton Wanderers.
Mazzarri has previously managed Napoli, Inter Milan and Watford.
Longo joins until the end of the season and will take charge of the team for the first time against Sampdoria at the weekend.