SAN DIEGO (AP) — A person familiar with the negotiations tells The Associated Press that All-Star infielder Manny Machado has agreed to a $300 million, 10-year deal with the rebuilding San Diego Padres, the biggest contract ever for a free agent.

The person spoke to the AP on condition of anonymity Tuesday because the agreement was subject to a successful physical and had not been announced. Machado can opt out after five years and become a free agent again, the person said.

Machado’s deal, if completed, would be the second-largest in baseball history behind Giancarlo Stanton’s $325 million, 13-year deal signed with the Miami Marlins ahead of the 2015 season.