When he walked off the mound after recording the final out of the ninth inning, all Jeurys Familia heard were boos.

He earned them.

The Mets closer, who set a team record with 51 saves in the regular season, allowed a three-run home run to Conor Gillaspie in the ninth as the Giants shocked the Mets, 3-0, in the NL wild-card game at Citi Field.

It wasn’t a save situation for Familia because the Mets never scored against Madison Bumgarner. But eventually, maybe, probably, Giants manager Bruce Bochy was going to have to take Bumgarner out of the game and the Mets would get a shot at someone else.

All the Mets needed was for Familia to get the game to the bottom of the ninth. So in a sense it was a save situation. They needed him to save them from their season ending.

He couldn’t. The Mets’ season has ended.

advertisement | advertise on newsday

“I’ve been in that situation before,” Familia said. “I know this is the game. Every time I go in there I try to do the best I can. I can’t control what happened. Just try to move forward.”

Familia said the same things after blowing saves in three World Series games last year. For all of his regular season success, Familia now has a loss and three blown saves in his last five postseason appearances. He did have five saves in the first two rounds in 2015.

Familia seems unflappable, and he should return next spring with plenty of confidence. But even manager Terry Collins said he felt the need to say something to Familia in the immediate aftermath of the game about not letting his postseason failures get to him.

Mets videos

“I think that’s something we certainly need to be careful of,” Collins said. “He’s a tremendous guy, as you know. In any circumstances like that, your first thought is you let your teammates down when all you did all year long was picked them up. But in the postseason when you give up [runs] and you lose games, it really can be hard on you. So I addressed it just now, not to get down about it. He was the guy I wanted out there in the ninth inning.”

It started with a double into the left-centerfield gap by Brandon Crawford. Familia struck out Angel Pagan after the former Met failed to get down two sacrifice bunt attempts.

But Familia then walked Joe Panik to bring up Gillaspie, a 29-year-old who had six home runs during the season and who may not have started the game if former Yankee Eduardo Nunez hadn’t been out with a hamstring injury.

Gillapsie took a high 1-and-1 sinker and sent into into Familia’s house — the Mets bullpen in right-center — to give San Francisco all the runs it would need.

“I threw my sinker, my best pitch,” Familia said. “Just trying to get a ground ball . . . .I can’t control what happened. I missed the location. That’s it.”

advertisement | advertise on newsday

And that was it for the Mets in 2016.