SEATTLE (AP) — The Oakland Athletics knew they'd been fortunate to get this deep in the season without seeing their bullpen blow a late lead.

It finally happened on Tuesday night, and in the process wrapped up the AL West title for the Houston Astros and sent the A's into a wild-card matchup with the New York Yankees.

Pinch-hitter Chris Herrmann's two-run homer in the 11th inning capped Seattle's late rally and gave the Mariners a 10-8 win over Oakland. Seattle overcame an 8-5 eighth-inning deficit and dropped the A's 2½ games behind the Yankees for home-field advantage in the Oct. 3 winner-take-all matchup.

Oakland had been 68-0 when leading after seven innings.

"We have a lot of confidence we're going to finish games, our bullpen is such a strength for us," Oakland manager Bob Melvin said. "To go perfect through the course of a season is probably tough to do."

Seattle's rally started with Denard Span's two-run double off Fernando Rodney in the eighth. Blake Treinen was one strike from closing out his 38th save in the ninth, but Nelson Cruz punched a two-out single, Ryon Healy reached when third baseman Matt Chapman bobbled his grounder for an error and Kyle Seager hit an RBI single. Treinen had allowed just one hit in his previous 13 appearances.

"We know they're loaded in the bullpen and you got to grind it out, have good at-bats and you got to get a little break once in a while," Seattle manager Scott Servais said.

Ben Gamel walked with one out in the 11th against Emilio Pagan (3-1), and Herrmann batted for Andrew Romine. He sent an 0-1 fastball out to deep right-center field for his second home run of the season. It was the fourth game-ending hit of his career, two of those homers.

"I hate extra-inning games, I'm sure a lot of people do," Herrmann said. "Just try to make the best of my opportunity tonight and I was just telling myself to make contract here. Knew that guy has a pretty good fastball, Pagan, and just really wanted to make solid contract. That was my goal and just kind of got it up in the air for a home run so it worked out in our favor."

Alex Colome (7-5) pitched the 11th for the victory.

A day after clinching no worse than a wild-card berth, Oakland took a 6-3 lead in the first two innings off Mike Leake. Nick Martini had a two-run triple and Matt Joyce a two-run single off Leake, and Marcus Semien added his 14th home run leading off the fifth inning. But the A's went scoreless after Matt Olson's RBI double in the sixth inning.

Oakland starter Brett Anderson lasted just 2 1/3 innings, giving up seven hits and five runs.

"Anytime you're handed a three-run lead and cough it up, and cough up another three-run lead it's frustrating," Anderson said. "If I did any semblance of my job we should have won this game. But unfortunately that wasn't the case."

HELLO AGAIN

Edwin Diaz, the major league leader in saves, pitched the 10th for Seattle. Diaz had not pitched since Sept. 17, when he collected his 56th save.

PLAYERS USED

Seattle used 26 players — 10 pitchers, 16 position players. It was the third-most players used in a game in franchise history. Most was 29 during a 16-inning game in 1992.

PLAYOFF PLANS

Melvin said the priority in the coming days will be making sure the A's regulars get a chance at some rest so they are fresh when the postseason begins. Melvin indicated getting his guys rest would take priority over trying to chase down the Yankees in an attempt to have the wild=card game at home and not in New York. The A's gave Khris Davis and Stephen Piscotty the night off on Tuesday.

"There is definitely a balance to this but I think the depth of our team allows us to be confident with who we give a day off to, whether it's in the lineup or in the bullpen," Melvin said. "But it is important at this point of time in the season that once we get to the postseason that guys are fresh. It's just as much of a mental grind as it is a physical grind, too. One of the strengths of our team is we use all our guys."

The one guy that may not get any rest is Matt Olson, who has a chance at playing in 162 games. Melvin said he probably won't start Olson at least one game against the Angels this weekend but will do what he can to make sure Olson reaches his goal of playing in every regular season game.

As for pitching, Melvin said the staff hasn't figured out who would pitch this weekend against the Angels, let alone in a wild card game.

"We're leaving everything open," Melvin said.

UP NEXT

Athletics: RHP Edwin Jackson (6-3) makes his 17th start since joining the A's on June 25. Jackson has a 3.18 ERA in his 16 starts, the fourth lowest in the American League during that stretch.

Mariners: RHP Felix Hernandez (8-13) makes what is likely his last start of the season. Hernandez will finish the year with a career-worst ERA (currently 5.46) and the 13 losses are one shy of his career-high.

More From 1460 ESPN