SAN DIEGO — Shortstop Didi Gregorius is joining manager Joe Girardi in Philadelphia, agreeing with the Phillies on a $14 million, one-year contract, a person familiar with the deal told The Associated Press.

The person spoke on condition of anonymity Tuesday because the agreement, first reported by the New York Post, had not been announced.

Gregorius spent the last five years with the New York Yankees, the first three playing for Girardi.

Girardi replaced Gabe Kapler as the Phillies' manager following a disappointing season in which Philadelphia faded to fourth place in the NL East and an 81-81 record despite signing slugger Bryce Harper.

Gregorius missed the early part of last season after Tommy John surgery to repair an elbow ligament torn during the 2018 playoffs. He hit .238 with 16 homers and 61 RBIs.

New York was wary of a long-term commitment to a shortstop who turns 30 in February. Gleyber Torres can move from second base to shortstop and DJ LaMahieu can become the Yankees' regular second baseman, freeing up money for starting pitching. New York is among the bidders for Gerrit Cole.