The New York Yankees signed third baseman Chase Headley to a four-year deal, the team announced Monday.

Sources told ESPN MLB Insider Buster Olney that the deal is worth $52 million. Headley also had reportedly been pursued by the San Francisco Giants, who have a void to fill at third base after Pablo Sandoval signed with the Boston Red Sox.

Headley, who was traded to the Yankees by the San Diego Padres prior to the trade deadline last season, hit a combined .243 last season with 13 home runs and 49 RBIs.

Following the trade to New York, he hit .262 with six home runs and 17 RBIs after hitting just .229 in 77 games with San Diego.

The signing leaves the Yankees with questions as what to do with Alex Rodriguez, who will be returning from his one-year suspension for violations of baseball's drug agreement and labor contract.

General manager Brian Cashman said at last month's GM meetings that A-Rod will have to win a job.

"If I signed a Chase Headley, he would be the starting third baseman," Cashman said then. "[Rodriguez] is going to compete for at-bats and for a position. The position would be third, and obviously DH, and that's it. Maybe some time at first base. He may be eventually the everyday third baseman, he may be the everyday DH; I just don't know."

The move gives some infield flexibility to the Yankees, as Headley can also play first base. Martin Prado, who also signed this offseason, can play at second base, third base and in the outfield.

But it certainly looks like for the first time in two decades, the soon-to-be 40-year-old Rodriguez, who has not played a full season since 2007 because of the suspension, leg operations and operations on both hips, will be coming to spring training without a job. He is under contract until 2017 and is owed a minimum of $61 million, a number that could swell by another $30 million, in $6 million increments, every time he reaches a contractual home run milestone.

Third baseman Chase Headley hit a combined .243 last season with 13 home runs and 49 RBIs for the San Diego Padres and the New York Yankees. Jim McIsaac/Getty Images

"That has nothing to do with devaluing Alex or disrespecting Alex or anything of that nature," Cashman said at the GM meetings in November. "It's just a fair assessment of the unknown. You can't quantify the unknown right now until you get him out there on a consistent basis to see if he can actually remain on the field, stay healthy, be productive and be that middle-of-the-lineup threat and force that we've all come to see for years gone by."

Headley, who played the previous six seasons for the Padres, had a breakout year in 2012, hitting 31 home runs and leading the National League with 115 RBIs -- big numbers considering Petco Park's dimensions and the lineup around him. He added a Gold Glove Award and finished a deserving fifth in the NL MVP voting.

Headley, who will turn 31 in May, was paid $10.525 million in 2014.

In eight seasons, he has hit .265 with 93 home runs and 418 RBIs.

Wallace Matthews of ESPNNewYork.com and The Associated Press contributed to this report.