The Philadelphia Phillies and outfielder Andrew McCutchen have agreed to a deal, sources confirmed to ESPN.

According to ESPN and multiple reports, McCutchen will receive a three-year, $50 million contract. The deal includes a team option for the 2022 season.

The 32-year-old, a five-time All-Star and the 2013 National League MVP, batted .255 with 20 homers and 65 RBIs in 155 games last season with the San Francisco Giants and New York Yankees. He hit .253 with five homers in 25 games for the Yankees after being acquired on Aug. 31.

McCutchen, long the face of a Pirates franchise that reached the playoffs each year from 2013 to 2015, was traded to San Francisco for right-hander Kyle Crick, minor league outfielder Bryan Reynolds and cash during the 2017 offseason. He played in at least 153 games in each of his last three seasons for the Pirates, batting .279 with 28 home runs and 88 RBIs in 156 games in 2017. He also hit .327 with 31 homers and 96 RBIs in 2012 and .317 with 21 homers and 84 RBIs in his MVP season for the Pirates.

McCutchen's major league debut on June 4, 2009, signaled Pittsburgh's intention to emerge from two decades of mediocrity. He was an All-Star by 2011, a charismatic presence in the clubhouse, beloved by a fan base that he helped reconnect with the game. Pittsburgh ended a two-decade postseason drought in 2013 and made three straight playoff appearances before falling to 78-83 in 2016 and 75-87 last year.

With a contract extension unlikely last offseason, Pittsburgh sent away its most important player since Barry Bonds left town as a free agent a quarter-century ago.

Seven months later, McCutchen was traded to the playoff-bound Yankees to help boost their outfield production a bit while they waited for slugger Aaron Judge to return from a midseason right wrist injury. The deal also allowed more flexibility for manager Aaron Boone to use the DH slot as a way to give outfielder Giancarlo Stanton more opportunities to rest his legs.

McCutchen takes solid, competitive at-bats, which is why both Giants manager Bruce Bochy and Boone installed him in the leadoff spot. His .368 on-base percentage last season ranked 20th among 141 hitters who qualified for batting titles, and his average of 4.2 pitches per plate appearance in 2018 represented the fifth consecutive year in which he has averaged at least four pitches per plate appearance. In more than 200 plate appearances in the leadoff spot in 2018, he had a .414 on-base percentage.

He was the No. 11 overall pick in 2005 and is a career .287 hitter with 223 home runs and 790 RBIs.

ESPN's Buster Olney and The Associated Press contributed to this report.