SEATTLE (AP) Marcus Semien made history Saturday when he committed his 35th error of the season, setting an Oakland Athletics team record.

He finished his night on a much better note, hitting a two-run homer in the 13th inning to lift the Athletics to a 7-5 victory over the Seattle Mariners.

''That's kind of the story of his season,'' Oakland manager Bob Melvin said. ''A guy that perseveres through a lot and doesn't let the negative things get him down, and then ends up hitting a huge home run.''

More from FoxSports

Semien's 15th home run gave the Athletics their first three-game winning streak in more than a month.

''That's what we've been trying to do all year, unfortunately it just hasn't worked out that way,'' Semien said. ''With one more game to go, it's nice to get a win like that.''

The Athletics had to rally in the ninth inning to send the game to extras, and Pat Venditte (2-2) entered in the 10th and pitched three scoreless innings to keep Oakland going until Semien's homer.

''You know the game's over if you're not making pitches,'' Venditte said. ''Your job is just to go out there and get the offense up - give them a chance.''

Danny Valencia hit a three-run home run in the first inning, his second homer in two days, but the Athletics trailed 5-4 going into the ninth inning.

Seattle's Tom Wilhelmsen came on for his 14th save opportunity and ended up with his second blown save of the season. Wilhelmsen walked Billy Burns to lead off the inning, then hit Mark Canha. The runners advanced to second and third on a wild pitch, allowing Brett Lawrie to tie the game at 5 with a sacrifice fly.

J.C. Ramirez (0-1) pitched a perfect 12th inning before running into trouble in the 13th, giving up a leadoff single to Stephen Vogt and then gave up Semien's homer on a 3-1 pitch.

''Honestly, I was thinking he was going to take it or maybe try to bunt it,'' Ramirez said. ''I just threw a fastball right down the middle and he got a good swing on me.''

Felix Doubront worked the 13th for his first save.

Robinson Cano had a three-run homer and extended his hitting streak to 15 games for the Mariners.

Mariners starter Roenis Elias had one of his worst outings of the season, giving up three runs in the first inning and getting knocked out of the game without recording an out in the third. Elias gave up four runs, seven hits and three walks in his shortest start of the year.

Elias allowed five straight batters to reach with one out in the first inning, including Valencia's three-run homer. In the third inning, the Athletics loaded the bases without an out against Elias on a single and two walks, leading Seattle manager Lloyd McClendon to bring in reliever Tony Zych.

Zych gave up a run-scoring fielder's choice to Vogt, giving Oakland a 4-0 lead, but the rookie kept the Athletics off the board over the rest of his career-high three innings of work, allowing one hit.

RARE STREAK

Oakland's last three-game winning streak came on Aug. 29-31. Before their current streak the Athletics had lost nine of 10.

MAKING IT COUNT

Valencia's home run was his 18th of the season, and was his 11th in 46 games with Oakland. Valencia has the most homers (tied with Rico Carty in 1978) and RBIs (37) of any Athletics player who played fewer than 50 games in a season.

TRAINER'S ROOM

Athletics: LHP Drew Pomeranz, who has not pitched since Sept. 26 with an AC joint inflammation, had an MRI and team orthopedist Dr. Will Workman recommended a shoulder clavicle resection. Pomeranz will get additional opinions before deciding whether to have the surgery. If he does elect for the procedure, recovery time will be about six week and it is expected he would be fully recovered for spring training, according to Melvin.

Mariners: DH Nelson Cruz was removed for a pinch-hitter in the 12th inning. Cruz said his groin was tight and he didn't want to push it. McClendon said it was unlikely Cruz would play in the final game of the season Sunday.

UP NEXT

Athletics: RHP Chris Bassitt (1-8, 3.60 ERA) will start the final game of the regular season for Oakland. Bassitt has lost four straight starts, and has the lowest winning percentage of any pitcher who has started at least 10 games this season.

Mariners: LHP Vidal Nuno (1-4, 4.19) will make his 10th start and 32nd appearance for Seattle.