OAKLAND, Calif. (AP) — Dee Gordon doesn't have many home runs this season. Two to be exact. So when Seattle's light-hitting utility player muscled up in the 12th inning, he celebrated by kissing both biceps as he stood in the dugout after crossing home plate.

It was a good-natured gesture toward a few of Gordon's teammates who were ribbing him as he rounded the bases. It was also an expression of relief for the Mariners, who lost the first two games of this series after sweeping first-place Houston on the road.

Gordon homered off Yusmeiro Petit to break a scoreless tie, and the Mariners beat the Oakland Athletics 2-0 on Wednesday to avoid a three-game sweep.

"I got lucky," Gordon said. "It's evening out. I've been lining out so much the last month."

Jean Segura had four hits to help the Mariners close within 2½ games of the A's for the second AL wild-card spot.

"We needed to get this ballgame today," Seattle manager Scott Servais said. "It's not going to get any easier, but we're starting to play with our confidence again and have some swag to our team."

Seattle's Mike Leake pitched eight innings of two-hit ball with six strikeouts and one walk. Oakland's Brett Anderson went 7 2/3 innings without allowing a run in his longest outing since June 16, 2015.

Nick Martini had three hits for the A's and Matt Olson added two. Oakland entered the day one game behind first-place Houston.

"In games like that, typically what happens, it's one pitch," A's manager Bob Melvin said. "That was the case today. Even though today was tough, we have to look at it as a positive. We took the series."

Both teams squandered numerous scoring opportunities before Seattle scraped together two runs on one hit.

After Petit (5-3) got leadoff man Denard Span to ground out, Mike Zunino walked. Gordon hit the next pitch over the right-field wall. Then he flexed and kissed his biceps.

"I was messing with Cam (Maybin) and (Denard Span) because they've been calling me skinny so I had to let them know I've got some guns," Gordon said. "And it was a big situation ... in a playoff race. Just having fun."

Gordon's only other home run was a solo shot against Cleveland on April 1 in Seattle's third game of the season.

James Pazos (3-1) retired one batter for the victory. Edwin Diaz pitched the 12th for his major league-leading 47th save in 50 opportunities.

The Mariners had two on with one out in the in the ninth and 11th but failed to score. The A's stranded Olson at second in the 10th, and then had two on in the 11th before Pazos got Khris Davis to strike out swinging.

Olson singled leading off the 12th before Diaz struck out Stephen Piscotty, Marcus Semien and pinch-hitter Chad Pinder.

CLOSING IN ON A RECORD

Diaz converted all six save opportunities on the Mariners' road trip and is one shy of the franchise record of 48 set by Fernando Rodney in 2014. Rodney is with the A's in a setup role.

THIS AND THAT

Segura leads the majors with 18 three-hit games. ... A's third baseman Matt Chapman doubled in the sixth to extend his hitting streak to a career-best 13 games. Chapman has also reached safely in 29 straight, the longest active streak in the AL.

TRAINER'S ROOM

Mariners: James Paxton was placed on the disabled list with a forearm bruise, one day after the left-hander was struck by a line drive. Felix Hernandez, who allowed two runs over 5 2/3 innings in his first career relief appearance, is likely to take Paxton's turn in the rotation. RHP Christian Bergman was recalled from Triple-A Tacoma.

UP NEXT

Mariners: LHP Wade LeBlanc (7-2, 3.80 ERA) pitches against the Dodgers on Friday in Seattle to begin a six-game homestand. LeBlanc is 1-7 in 11 career appearances against Los Angeles.

Athletics: RHP Edwin Jackson (4-2, 2.48) faces the Houston Astros on Friday. Jackson's ERA is the fourth-lowest in the American League since he joined Oakland on June 25.

More From 1460 ESPN