Jonny Gomes' pinch-hit, leadoff homer in the bottom of the ninth sent Boston over San Diego, 2-1, in the second contest in a three-game interleague set.
Gomes greeted Luke Gregerson (4-4) with a deep drive which barely landed in the seats over the Green Monster off a hanging breaking ball to end the contest.
"He stays prepared," said Red Sox manager John Farrell. "That's one thing, in the role that he's in, he's got a lot of experience in it and I guess a flair for the dramatic."
Koji Uehara (2-0) tossed a scoreless top of the ninth for the win.
Jarrod Saltalamacchia knocked in Mike Carp with a double for the Red Sox, who recorded their eighth walk-off victory this season with their seventh win in their last eight games.
Kyle Blanks drove in the lone run for the Padres, who dropped their seventh contest in the last nine.
San Diego picked up a run in the first with two down off Sox starter Jon Lester, thanks to consecutive two-out singles from Carlos Quentin, Chase Headley and Blanks.
The hosts failed to crack the scoreboard in the home third after loading the bases with two outs thanks to a Jose Iglesias plunking, single from Jacoby Ellsbury and intentional walk to David Ortiz when Daniel Nava grounded out.
However, Boston equalized in the fourth off San Diego's Edinson Volquez, as Carp slugged a leadoff single and scored when Saltalamacchia followed with a double.
The Padres left Quentin on third in the sixth, then a Saltalamacchia strike out left two on in the home eighth.
Lester scattered six hits and one run with five strikeouts over seven innings, while Volquez allowed seven hits and one run while fanning six in six full frames ... The Red Sox have won eight of 13 all-time meetings with the Padres since their first matchup in 2002 ... San Diego took two of three from Sox in Boston from June 20-22, 2011 ... Gomes hit his third pinch-hit home run of the season, becoming the first Red Sox player to accomplish the feat since Bernie Carbo in 1977.