The Argentinian striker, who joined the Hammers in the summer of 2014, had fallen out of favour with Hammers boss Slaven Bilic.
Zarate had a loan spell at QPR last season and scored five goals in the current campaign, his last in the 1-1 draw against West Brom in November.
In a statement on their official Twitter feed, the Hammers announced: "[Zarate] has joined @acfiorentina on a permanent contract.
"#WestHam would like to thank Mauro for his efforts in Claret and Blue and wish him all the best in his future career #WHUFC"
Earlier, Zarate had effectively confirmed his departure by tweeting a heartfelt tribute to the club's owners and supporters.
Zarate wrote: "I would like to thank David Sullivan and David Gold for believing in me and for giving me the opportunity of playing at such a special club like West Ham.
"I would also like to thank my team-mates for the good times we shared and wish them the very best for the future, and especially I would like to thank from the bottom of my heart all the West Ham supporters for their unconditional support and affection, you are truly unique."
Zarate arrived in England on loan to Birmingham in 2008 and after further loans at Lazio and Inter Milan he joined the Hammers in 2014.
But despite a promising start Zarate struggled for consistency and it became increasingly apparent he was not part of new boss Bilic's long-term plans.
Source: PA