Updated

After a four-run sixth inning, the Seattle Mariners held on to beat the Minnesota Twins, 5-4.

Blake Beavan (9-8) had allowed 13 earned runs over his last 22 1/3 innings in four previous starts, but held the Twins to two runs on five hits in seven innings on Thursday.

"Beavan really struggled in that first inning but he really righted himself," Seattle manager Eric Wedge said. "He mixed his pitches better, developed some confidence in his secondary pitches and got us really deep in the ball game."

Kyle Seager and Trayvon Robinson eached knocked in a pair of runs for the Mariners, who took three-of-four games in the series against Minnesota.

Brian Duensing (3-10) lost for the fourth time in his last five starts after he gave up four runs -- three earned -- on four hits in 5 1/3 innings.

Josh Willingham hammered a two-run home run, his 33rd of the season, for the Twins, who lost for the 17th time in their last 21 games.

Seattle trailed 2-1 entering the sixth inning, but after Dustin Ackley walked between singles by Brendan Ryan and Franklin Gutierrez, the bases became loaded with no one out. Seager lofted a fly ball to center field to tie the game at two. Jesus Montero then sent a fly ball to left field, but Josh Willingham dropped it, allowing Ackley to score and give Seattle the lead.

After Justin Smoak struck out and John Jaso walked to reload the bases, Robinson lined a single through the right side to score two and give the Mariners a 5-2 lead.

"You miss a play and still we had a chance," Twins manager Ron Gardenhire said. "Still had a chance to get out of the inning and then they had another hitter up there and he gave up a base hit ... We had chances even after (the error). Normally an error kills you and, in that case, it cost us some runs."

Minnesota gave the Mariners a scare in the eighth and ninth innings.

Alexi Casilla worked a one-out walk against Charlie Furbush and Willingham followed with a two-out, two-run homer to left field to bring the Twins within one in the eighth. Morneau then came to bat and hit with a long fly ball, but Eric Thames made the catch on the warning track in right field to escape the inning.

Tom Wilhelmsen worked past a pair of walks and stranded a runner on third to close out the win and earn his 21st save.

Seattle took an early lead in the top of the first inning. Gutierrez lined a one-out double to right and scored on Seager's single.

Minnesota responded with a pair of runs in the bottom of the first. Ben Revere led off with a base hit, stole second and scored on a base hit by Casilla. Mauer moved Casilla to third with a base hit and Justin Morneau scored him with a sacrifice fly to center field.

Game Notes

Seattle has won eight of its last nine games against Minnesota ... The Mariners have won 17 of their last 18 games against teams currently under .500 ... Seattle starting pitchers are 20-9 with a 2.86 earned run average since July 19 ... Seattle went 3-for-5 with runners in scoring position and stranded four ... Minnesota went 1-for-8 with runners in scoring position and left six on base.