Foyth joined the Spanish club on loan last summer and as part of that deal they had the option to make the move permanent.
Villarreal have now exercised that option and Foyth has put pen to paper on a five-year contract at the club.
The 23-year-old enjoyed a fine season on loan with Villarreal, helping them go all the way in the Europa League.
In total, the Argentina international played over 30 games for the club, often operating at right-back.
Foyth had slipped down the pecking order at Spurs, who he joined in 2017 for around £8million.
His sale has reportedly generated around £13m for Tottenham and should boost their coffers ahead of the summer transfer window.
In a statement on Friday, Spurs said: “We can confirm that Villarreal has exercised the option to sign Juan Foyth on a permanent basis.
“The Argentina defender joined us in August, 2017 from Estudiantes and went on to make 32 appearances, scoring once.
“Juan moved on loan to Villarreal in September, 2020 and made 32 appearances in total for the La Liga side last season, including their Europa League final win against Manchester United.
“We wish Juan all the best for the future.”