MIAMI — Heriberto Hernández hit the first grand slam of his career — a 416-foot walk-off shot in the ninth inning — to lift the Miami Marlins to a 4-0 victory over the New York Mets at loanDepot park, completing the club’s first three-game home sweep of New York since 2019.

The blast off Mets reliever Devin Williams was the first walk-off grand slam in a 0-0 MLB game since the Royals’ Justin Maxwell hit one on Sept. 22, 2013. Hernández connected on an 83.9 mph changeup and sent it to right-center field at an exit velocity of 104.9 mph — his second home run of the season and the second-longest of his career, topped only by a 439-foot shot against the Rays earlier this month.

“I thought that the ball was going to go over the center fielder, but I didn’t know that the ball was going to leave,” Hernández said. “I was just trying to put it in play. I wasn’t trying to do too much. I knew that if I put it in play, the runner was going to be able to come in.”

The ninth-inning rally began when Christopher Morel led off with a double. Liam Hicks drew a one-out walk, and Williams intentionally walked Xavier Edwards to load the bases before Hernández stepped in. The 26-year-old had entered the game as a pinch-hitter for Owen Caissie against left-hander Brooks Raley in the seventh inning, singling to load the bases before Kyle Stowers grounded out to keep the game scoreless.

“Since the first inning, [manager] Clayton [McCullough] told me that I was going to play in case Caissie had a turn against Raley,” Hernández said. “So I prepared like I was playing, like I do every day. I have been staying positive every day. I know that I can enter at any time to help with defense, running or batting.”

Manager Clayton McCullough said Hernández has started to resemble the player who slashed .266/.347/.438 with a .785 OPS last season. “The look in the box from the swings he’s getting off, the balance,” McCullough said. “It seems like [the time in the Minors] was a little bit of a breather for [Hernández]. I think mentally, again, he should know that he can perform here.”

Miami’s pitching staff held New York to two runs over the three-game series, including starter Tyler Phillips, who made his first Major League start of the season. Phillips was in the training room during Hernández’s at-bat and initially thought the hit was a walk-off single. “Everyone exploded; we were jumping up and down,” Phillips said. “It was a blast in there, though. We had a huge group in there, and we were just pulling for our boys.”

“My whole life, I wanted to be in the Major Leagues,” Hernández said. “Whether I am playing or not, I feel great and happy to be here. We have a good team, and the pitching was really good, too. Untouchable, like it has been all these three days.”

The sweep gave the Marlins their first three-game winning streak since opening the season with a sweep of the Rockies. Miami has won five of its past six games against New York dating back to last August.