The deal, worth $1 million in 2008 and $1.6 million in 2009, includes a $250,000 signing bonus and a $2 million club option for 2010.
The 26-year-old Villarreal was traded by Atlanta for outfielder Josh Anderson last month. He was 2-2 with a save and a 4.24 ERA for the Braves last season.
Villarreal is 23-12 with a 3.71 ERA in a five-year career that started in Arizona. He set an NL rookie record with 86 appearances for the Diamondbacks in 2003, when he was 10-7 with a 2.57 ERA.