SAN DIEGO (AP)Reliever Robert Suarez agreed Thursday to remain with the San Diego Padres under a $46 million, five-year contract, according to a person with knowledge of the deal.

The person spoke with The Associated Press on condition of anonymity because the contract hasn’t been finalized pending a physical. Suarez can opt out after three years.

Suarez, a 31-year-old rookie, was having a terrific postseason until allowing Bryce Harper’s go-ahead, two-run homer with no outs in the eighth inning of Game 5 of the NL Championship Series that sent the Philadelphia Phillies to the World Series.

Manager Bob Melvin was criticized by some for letting Suarez pitch to Harper instead of using left-hander Josh Hader. Melvin said Hader wasn’t ready when Harper came to bat and that he wanted to get through the final three innings with Suarez and Hader, the Padres’ two best relievers. Melvin said he wanted to get two outs from Suarez in the eighth and the final four outs from Hader. Philadelphia won 4-3.

Suarez was especially impressive in the NL Division Series win over the Los Angeles Dodgers, throwing four scoreless innings in three appearances. He pitched two scoreless innings in a wild-card series win against the New York Mets.

He went 5-1 with a 2.27 ERA in 45 appearances during the regular season.

AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports