Everton targeted Silva as a replacement for Ronald Koeman after the Dutchman was given the boot at the end of October, but
Watford strongly resisted having only appointed Silva in the summer after he left Hull City following their relegation.
Gracia, 47, signed an 18-month contract with Watford who lie 10th in the standings.
"Watford FC is delighted to announce the appointment of Javi Gracia as the club’s new Head Coach," the club said on their
"During two seasons with Malaga he achieved back-to-back top-10 La Liga finishes, famously defeating eventual Champions League and Spanish champions
Barcelona at the Camp Nou in February 2015."
In the following season, Malaga went unbeaten against both Real Madrid and Atletico Madrid and finished eighth in La Liga.
Gracia moved to Rubin Kazan for the 2016-17 season but left after they finished ninth in the Russian League.
Everton had targeted Silva in their quest to replace Dutchman Ronald Koeman in November but were refused permission to approach him and appointed former England manager Sam Allardyce instead.
"This has been a difficult decision and one not taken lightly," Watford said.
"The club is convinced the appointment of Silva was the right one and had it not been
for the unwarranted approach by a Premier League rival for his services we would have continued to prosper under his leadership.
"The catalyst for this decision is that unwarranted approach, something which the board believes has seen a significant
deterioration in both focus and results to the point where the long-term future of Watford FC has been jeopardised."
Silva, 40, joined Watford from Hull City on a two-year deal in the close season and took them up to fourth after eight matches.
Watford have since struggled for
consistency, winning just once in the past 11 league games.
They were beaten 2-0 by Leicester City on Saturday, their third league defeat in four matches.
Gracia, who played for a number of La Liga clubs including Athletic Bilbao and Villarreal, will be Watford's 10th manager since the
Pozzo family took over the club only six years ago.
They visit Southampton in the FA Cup fourth round on Saturday and Stoke City in the Premier League on Jan. 31.