The 54-year-old, who has also coached Napoli and Sampdoria, signed a three-year deal as head coach starting on July 1, Watford said on their website.
Spaniard Flores was sacked despite leading Watford to a 13th-place finish in the Premier League and the semi-finals of the FA Cup in his only season in charge.
Mazzarri is the eighth head coach to work under the club's Italian owner Gino Pozzo, whose family took over the club in 2012. Watford have had five managers in the past two years.
“Walter has been the target of a number of approaches for his services, so we're delighted to secure him as head coach here at Watford,” said CEO Scott Duxbury.
“We're thoroughly looking forward to working with such a highly-regarded coach, with the progress and development of the club always remaining the highest priority.”
Mazzarri has been out of work since being sacked by Inter in November 2014 after a disappointing 18-month spell in charge.
The journeyman midfielder, who had a 15-year career with mostly unsung teams in Italy, began his coaching career in the lower leagues in 2001, taking Livorno into the top flight in 2004 before keeping Reggina in Serie A for three seasons.
The Italian guided Sampdoria to a sixth-place finish in 2008, qualifying for the Uefa Cup, and they were runners-up in the Coppa Italia the following season after losing to Lazio.
He then led Napoli to Coppa Italia success in 2012 and a second-place Serie A finish the following season.
Flores joined Watford as head coach at the start of last season to replace Serbian Slavisa Jokanovic, who left despite steering them into the top flight as Championship runners-up.
Former Atletico Madrid and Valencia coach Flores, who had a break clause in his contract, said he and the club's board had a different perspective on the team's progress.
The club is based to the north-west of London and boast pop singer Elton John as their honorary life president.
Original source: Watford confirm Mazzarri as new manager