The deal was announced Tuesday night.
Iwamura hit .290 with one homer and 22 RBIs in 69 games during the final season of a $7.7 million, three-year contract he signed after playing in the Japanese Central League for eight years.
The 30-year-old missed 81 games this season after sustaining partial tears of the anterior cruciate ligament and meniscus in his left knee. The Rays held a $4.85 million option on the infielder for 2010.
Chavez led Pittsburgh and all major league rookies with 73 appearances in 2009, going 1-4 with a 4.01 ERA in 67 1-3 innings. He was taken in the 42nd round in 2002 by Texas.