MINNEAPOLIS -- Max Kepler went 3-for-6 with four RBIs and drove in the winning run with a two-out single in the bottom of the ninth as the Minnesota Twins rallied for a 7-6 victory over the Oakland A's on Sunday afternoon, July 21, at Target Field.

Kepler also homered and doubled as the Twins won for just the second time in seven games.

Ehire Adrianza had tied the game earlier in the ninth off Liam Hendriks (4-1), who was pitching in his third consecutive game, when he tripled off the top of the wall in right field, driving in Luis Arraez who had singled.

Arraez finished 3-for-5 to increase his batting average to .381 in 113 at-bats. Adrianza went 3-for-5 with two runs and two RBIs.

Kohl Stewart (2-1) picked up the win with one inning of scoreless relief.

Josh Phegley homered and drove in three runs, and Matt Chapman had two hits for Oakland, which lost for just the second time in 10 games despite garnering nine walks off five Minnesota pitchers.

The Twins took a 1-0 lead in the first inning when Kepler led off with a double and scored on a double by Jorge Polanco.

Minnesota extended its lead to 4-0 in the second when Kepler hit his team-leading 24th home run of the season, driving in Adrianza, who had doubled, and Jason Castro, who had walked. It was the 182nd homer of the season for Minnesota, tops in the majors.

Oakland cut it to 4-2 in the fifth inning when Jurickson Profar drew a one-out walk and Phegley followed with his 10th home run of the season.

Minnesota increased its lead to 5-2 in the bottom of the fifth on an RBI single by Adrianza, but the A's chipped away with a pinch-hit sacrifice fly by Chad Pinder in the sixth and cut the lead to 5-4 an inning later when Marcus Semien walked, advanced to third on a double by Chapman and scored on a wild pitch by reliever Trevor May.

The A's then took the lead in the eighth when Grossman drew a one-out walk and scored on Chris Herrmann's pinch-hit double off the top of the wall in right-center field. Franklin Barreto, pinch running for Herrmann, advanced to third on a passed ball by Castro. Phegley followed with a sacrifice fly to put the A's in front 6-5.