NEW YORK (AP) — Bryce Harper and the Philadelphia Phillies have agreed to a $330 million, 13-year contract, the largest deal in baseball history, a person familiar with the negotiations told The Associated Press.

The person spoke to the AP on condition of anonymity Thursday because the agreement is subject to a successful physical.

A 26-year-old All-Star outfielder, Harper topped the $325 million, 13-year agreement outfielder Giancarlo Stanton reached before the 2015 season with the Miami Marlins. His average annual value of $25.4 million ranks 14th in baseball history.

Harper’s agreement, first reported by the MLB Network, tops the previous high for a free agent, set last week when infielder Manny Machado signed a $300 million, 10-year deal with the San Diego Padres.

Harper gets a $20 million signing bonus, a $10 million salary this year, $26 million in each of the following nine seasons and $22 million in each of the last three years. None of the money is deferred.

Philadelphia has been among the most active teams this offseason, adding outfielder Andrew McCutchen for $50 million over three years and reliever David Robertson for $23 million over two years, and acquiring catcher J.T. Realmuto and shortstop Jean Segura.

After leading their division in early August, the Phillies went 16-33 over the final 49 games of last season and at 80-82 finished with a losing record for the sixth straight season.