SEATTLE (AP) — With the Seattle Mariners struggling to find offense, Jean Segura wasn't going to sit through a long at-bat looking for a perfect pitch. In this situation, the first one was good enough.

Segura chopped the first pitch from Sam Dyson into center field to score Guillermo Heredia with the go-ahead run in the eighth inning, and the Mariners won yet another one-run game by beating the San Francisco Giants 3-2 on Wednesday.

Seattle came up with just enough offense to split the two-game interleague series, and it was one of the Mariners' All-Stars who came through. Heredia walked leading off the eighth inning against Tony Watson (3-4) and advanced to second on Dee Gordon's bunt. Gordon was initially called safe but was out on a video review.

Dyson, who shut down the Mariners a night earlier, took over and was greeted by Segura's chopper up the middle, and Heredia beat the throw home from Steven Duggar. Seattle improved to a league-best 27-12 in one-run games this season.

"I was just trying to get a sinker down and over the plate. He threw a perfect pitch to put a good swing on it," Segura said.

Seattle is in the midst of an offensive swoon, scoring three runs or fewer in 11 of the past 14 games. Trying to rediscover the offense of May and June has been a struggle, both going into and coming out of the All-Star break, which puts more an emphasis on winning games like Wednesday.

Segura had a first-inning sacrifice fly and two of Seattle's three RBIs. Ryon Healy added his 21st home run , a solo shot in the second inning.

"You go through these stretches during the course of the season. It's tough," Seattle manager Scott Servais said. "It's not like these guys aren't trying or trying to make adjustments or whatnot. It's just the ballgames we're playing in right now. We've got to get it going offensively."

Managing a lagging offense is easier when Seattle gets the kind of pitching it received from starter Mike Leake and Edwin Diaz closing it out. Leake pitched into the seventh before giving way to the bullpen. Alex Colome (3-5) pitched the eighth inning and Diaz struck out the side in the ninth for his league-best 38th save in 41 chances .

Leake cruised through the first five innings on just 51 pitches and one hit allowed. San Francisco threatened in the sixth thanks to an error on Hunter Pence's groundball and a single by Nick Hundley to open the inning. The runners advanced to second and third with one out, but Leake responded with his first two strikeouts. He got Alen Hanson swinging over a slider before watching Andrew McCutchen miss swinging at a cutter

San Francisco got to Leake an inning later when Brandon Crawford's blooper fell in for a double off the sliding glove of Denard Span in left to score pinch-runner Chase d'Arnaud. Hunter Pence followed with a two-out broken-bat single off reliever Juan Nicasio to score Crawford with the tying run.

"We just have to get this offense clicking and moving," San Francisco manager Bruce Bochy said. "They're fighting. We've been down almost every game and they're coming back to tie it and take the lead. That is such a great sign of how hard they are fighting. We just couldn't put it away."

COOPERSTOWN BOUND?

Bochy is hopeful he'll be able to attend the Hall of Fame inductions this weekend in Cooperstown of his former player Trevor Hoffman and his former coach Alan Trammell. Bochy said it's still unclear if he'll be able to attend and the logistics are challenging. He wouldn't leave until after the Giants home game on Saturday night and would try and rejoin the team Monday in San Diego.

TRAINER'S ROOM

Giants: Brandon Belt left in the seventh inning after reaching on an infield single. Bochy said Belt suffered a hyperextended right knee and the best case is he'll miss two or three days. Belt appeared to be hurt taking a hard step after reaching first base. "Hard to really pinpoint what happened because I started feeling it when I was walking from first to second, and it buckled on me a little bit," Belt said.

Mariners: RHP Erasmo Ramirez is scheduled to pitch for Triple-A Tacoma on Wednesday night as he recovers from muscle strain in his right arm that's had him on the disabled list since May 1.

UP NEXT

Giants: San Francisco returns home to open a four-game series with Milwaukee. Dereck Rodriguez (5-1) will start Thursday's opener. The Giants have won his last six starts and are 7-1 overall in games he's started this season.

Mariners: Seattle opens a three-game series against the Angels on Friday with Wade LeBlanc (6-1) on the mound. The Mariners are 11-4 in his 15 starts this season and tied a career-high with 10 strikeouts in his last outing against the White Sox.