The 24-year-old spent the second half of last season on loan at Vicarage Road, scoring once in seven Premier League appearances for the Hornets.
Deulofeu will now return to Hertfordshire on a five-year contract after Barcelona confirmed the transfer yesterday.
Announcing the deal on their website, the LaLiga champions thanked Deulofeu and wished him luck for the future.
The club said in a statement: “FC Barcelona and Watford FC have reached an agreement for the transfer of Gerard Deulofeu to the English club.
They have agreed on a fee of €13m, plus €4m in variables. FC Barcelona will also receive a percentage of any future transfer operations to other clubs.
Watford confirmed Deulofeu has signed a long-term deal, with chairman Scott Duxbury insisting the move shows the club are constantly striving to improve their squad.
“We are very pleased to welcome Gerard back to Vicarage Road and thank FC Barcelona for their part in concluding this deal,” Duxbury told the club’s website.
“Our ambition to succeed and grow in the Premier League remains as strong as ever.”
A product of Barcelona’s famed La Masia academy, Deulofeu struggled to break into the first team at the Nou Camp and was loaned out to Everton.
He was a hit under Roberto Martinez at Goodison Park and, following a loan stint at Sevilla in 2014/15, was signed permanently by the Toffees.
Another loan opportunity presented itself in January 2017 as Deulofeu opted to join AC Milan on a temporary basis.
Strong showings in Milan convinced Barca to take up their buy-back option — but establishing himself in Catalonia would again prove to be an impossible task for Deulofeu.
Yet another loan move was agreed, this time a Premier League return with Watford, who have now decided to take the player on a permanent deal.