Free-agent outfielder Carlos Beltran has agreed to a three-year, $45 million deal with the New York Yankees, sources confirmed to ESPN.com on Friday night.

Beltran, 36, hit .296 with 24 home runs and 84 RBIs in 145 games this past season for the NL champion St. Louis Cardinals.

Beltran took $3 million less to sign with the Yankees, sources told ESPNNewYork.com's Andrew Marchand. Beltran had an offer for three years and $48 million with another club. A source with knowledge of those discussions said Beltran was "down the road" with that team.

Beltran met with the Arizona Diamondbacks in Phoenix earlier this week, when the team made a three-year offer exceeding $45 million, The Arizona Republic reported Friday.

The Kansas City Royals, Beltran's first major league team, also pursued him. But the Royals filled their outfield void with a trade for Milwaukee's Norichika Aoki on Thursday.

At 7 p.m. ET, Yankees general manager Brian Cashman called and the two sides -- who have been talking the whole offseason -- agreed to the deal over the next two hours.

The pact with Beltran, which comes on the same day former Yankees second baseman Robinson Cano agreed to a 10-year, $240 million deal with the Seattle Mariners, marks the latest addition to a revamped lineup in the Bronx.

Beltran and fellow free-agent signings Jacoby Ellsbury and Brian McCann will give manager Joe Girardi a decidedly new batting order for a total long-term cost of $283 million.