The blast to left field capped an impressive June for the Marlins, who finished 15-10 in the month after being 14-41 in April and May combined.
"That was awesome," Mathis said. "That's the first walk-off home run that I hit. That was up there with the walk-off in the playoffs."
The setting was different Sunday from when Mathis delivered a walk-off double for the Angels to beat the Yankees, 5-4, in 11 innings on Oct. 19, 2009. Still, the feeling of elation crossing the plate and being mobbed by teammates was the same.
"Any time you are celebrating with your team on the field, no matter what it is, it's a good feeling," Mathis said.
The Marlins on Sunday honored their 20th anniversary, inviting back several prominent former players. Mathis came through with what turned out to be the 3,000th home run in franchise history.
Mathis' second career grand slam was his first walk-off home run, and it gave the Marlins a 2-1 lead in the four-game series that concludes Monday.
"He's a veteran guy," Marlins manager Mike Redmond said of Mathis. "He does such a great job with the pitching staff. I think sometimes we forget, not only are we developing our young players, we're developing our pitching staff as well. That's probably going to be the thing that carries us over that long haul, our pitching staff and our defense."
Leading off the ninth, Tyson Ross walked Logan Morrison on five pitches, and the Marlins were immediately threatening. Marcell Ozuna singled, setting up the Marlins with runners on first and second and no outs. Derek Dietrich's fly ball to right advanced Morrison to third, and pinch-hitter Greg Dobbs was intentionally walked to load the bases.
Mathis entered the game 1-for-15 (.067) with runners in scoring position, so he understood why the Padres opted to go after him.
"I've had a bunch of chances with guys on base, and I hadn't really gotten the job done, which is why that is even more sweet right now," he said. "To be able to produce."
The Padres loaded up their infield by shifting center fielder Alexi Amarista in, positioning him at second base.
Mathis ended it by blasting a 1-0 offering into the Padres' bullpen.
"Too much plate," Ross said. "Bases loaded, down 1-0, had to come with a strike right there and just got too much plate."
The Marlins celebrated their fourth walk-off win of the season and first since April 30 against the Mets.
Nathan Eovaldi, making his third start since coming off the disabled list, worked six scoreless innings in a solid start. The hard-throwing right-hander scattered four hits and three walks.
For the first time in 18 straight starts going back to last season, Eovaldi did not record a strikeout. His last start without a strikeout was exactly one year ago against the Mets.
Eovaldi threw a season-high 89 pitches, but he was lifted an inning after being struck on the right shin on a comeback grounder off the bat of Kyle Blanks. The ball deflected to Morrison at first for the out. Eovaldi tested the shin by throwing one warmup pitch, and he retired the next two batters.
But Redmond saw no reason to chance anything.
Andrew Cashner held the Marlins without a hit for 3 2/3 innings before surrendering three consecutive hits and two runs in the fourth.
Morrison started the rally with a flare to left field that was just out of shortstop Pedro Ciriaco's reach. Morrison had a mental lapse, forgetting how many outs there were when Ozuna's single dropped in front of a diving Will Venable in right field.
Morrison hesitated to see if the ball would be caught and advanced just to second instead of reaching third. It did not matter, as Dietrich delivered a two-run double to deep left-center, opening the scoring.
In the seventh inning, the Padres tied it on Carlos Quentin's two-run, pinch-hit homer off Chad Qualls.
Before belting his walk-off slam, Mathis made a big play in the top of the ninth inning, throwing out Mark Kotsay trying to swipe second on a botched hit-and-run. Mike Dunn walked Kotsay, and Steve Cishek was brought in to face Yasmani Grandal.
On a 1-0 pitch, Grandal swung and missed, and Mathis threw a perfect strike to shortstop Adeiny Hechavarria, who applied the tag.
"It's a tie game, and that's a big play," Redmond said. "If he hits a ground ball and it's first-and-third, that's a big play for them. He swung and missed, and we threw him out. That was really a transfer of momentum for us."