The Spain international defender is Aston Villa's second summer signing after Youri Tielemans joined from relegated Leicester City on a free transfer.
Torres has courted interest from some big clubs in the past but it is Aston Villa who have pulled off a deal to bring the 26-year-old to Villa Park.
Aston Villa manager Unai Emery worked with Torres for three seasons at Villarreal as the pair won the Europa League in 2021, beating Manchester United on penalties in the final.
Torres came through Villarreal's youth ranks and made 173 appearances, scoring 12 goals.
Villa had teased the long-awaited signing by posting a video of a player wearing the club's new kit with the caption: 'Good things come to those who wait.'
The club then posted the official reveal ushering in his arrival, saying: 'Aston Villa is delighted to announce the signing of Spanish international Pau Torres from Villarreal!
Aston Villa finished seventh in the Premier League last season and will play Europa Conference League football in the upcoming campaign.
Torres has won 23 caps for the Spain national team and played at last year's FIFA World Cup in Qatar.