Reliever Robert Suarez agreed Thursday to stay with the San Diego Padres on a five-year, $46 million deal, according to a person with knowledge of the deal.

The person spoke to The Associated Press on condition of anonymity because the deal has not been finalized and is still pending a physical exam. Suarez can terminate the agreement after three years.

Suarez, a 31-year-old rookie from Venezuela, was having a terrific postseason run until he gave up a go-ahead two-run homer to Bryce Harper with no outs in the eighth inning of Game 5 of the NL Championship Series.

The Philadelphia Phillies prevailed and advanced to the World Series.

Some criticism was leveled at manager Bob Melvin for allowing Suarez to face Harper instead of going with southpaw Josh Hader. Melvin said Hader wasn’t ready when Harper got to the batter’s box. He added that he wanted to cover the last three innings with Suarez and Hader, the two best relievers in San Diego.

The manager explained that he wanted Suarez to get two outs in the eighth inning and Hader to get the next four.

Philadelphia triumphed 4-3.

Represented by the firm Amuse Sports, Suárez will earn salaries of 10 million in each of the first three years of the contract and eight million in the last two.

Plus, he can get $3 million a season if he finishes a certain number of games. Those incentives will be covered if Hader doesn’t stay after his contract expires at the end of next season and if Suarez becomes the closer.

Suárez particularly shined in the National League division series against the Los Angeles Dodgers. He pitched four blank episodes across three appearances.

He pitched a couple of innings in a win over the New York Mets in the wild card series.

In the regular season, he went 5-1 with a 2.27 ERA in 45 appearances.

Categorized in: