The Philadelphia Phillies agreed Friday to a three-year, $60-million contract with veteran first baseman Carlos Santana, the franchise’s biggest free-agent signing in seven years, and a stunning transaction that signaled a sudden change in philosophy for a team that had pledged at-bats to a young player at every position in 2018.

Santana turns 32 next April, and the Phillies were enticed by the chance to obtain him on a three-year commitment.

The Phillies, earlier in the day, traded their longest-tenured player to San Diego for a minor-league pitcher.

The Phillies moved Hoskins to left field last season before his major-league debut in order to play Tommy Joseph and him at the same time.

The Phillies ended the 2017 season with three young, capable outfielders in Odubel Herrera, Aaron Altherr and Nick Williams.

Cleveland made a qualifying offer to Santana, which means the Phillies will lose their second-round pick in the 2018 draft and $500,000 from their international signing bonus pool for 2018-19.

The Phillies, according to a Boston Globe report, outbid the Red Sox for Santana.