SAN DIEGO (AP)Matt Carpenter agreed Tuesday to a $12 million, two-year contract with the San Diego Padres after reviving his career with the New York Yankees in a season cut short by injury.

The agreement for the infielder/outfielder could be worth $21 million over two seasons if he has 550 plate appearances in each year.

Carpenter, 37, was a three-time All-Star with the St. Louis Cardinals who began last season at Texas’ Triple-A team in Frisco. He signed with the Yankees on May 26 and hit .305 with 15 homers and 37 RBIs in 47 games and 154 plate appearances before breaking his left foot when he fouled off a pitch at Seattle on Aug. 8. Carpenter returned for the playoffs but went 1 for 12.

An outfielder, third baseman and first baseman, Carpenter has a .263 average and .678 OPS in 12 seasons with the St. Louis Cardinals (2011-21) and Yankees (2022).

Carpenter gets a $3 million signing bonus payable in three installments and a $3.5 million salary this year. The deal includes a $5.5 million player option for 2024.

He can earn $3 million in performance bonuses in each year for plate appearances: $500,000 each for 300 and each additional 50 through 550. His 2024 option price would escalate by the amount of any performance bonuses earned in 2023.

His 2022 deal with the Yankees had a $2 million salary over a full season.

AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports