OAKLAND, Calif. -- Rajai Davis made sure that Oakland Athletics manager Bob Melvin's 1,000th career major league victory was unforgettable.
Davis hit a two-run, walk-off homer in the ninth inning, lifting the A's to an improbable 5-4 victory over the Minnesota Twins on Saturday night at Oakland Coliseum.
The walk-off RBI was the ninth of Davis' career, and the walk-off homer was his second. His first came in 2014 with the Detroit Tigers against the A's.
"I think it's a ball that they can find," Davis said. "Hopefully, they can find it for (Melvin) and frame it real nice for him so he can set it up on his wall."
After pinch-hitter Adam Rosales worked a leadoff walk, Davis launched reliever Taylor Rogers' 1-0 pitch over the left-center field fence. Rogers fell to 5-3 and 0-for-3 in save opportunities.
Davis went 4-for-5 with a double to go with his home run and scored twice. He matched his season high for hits.
The A's snapped a five-game losing streak and ended Melvin's wait for 1,000 on the day that the late Bill King, who broadcast so many memorable moments in A's history, was inducted into the Baseball Hall of Fame.
"It's a bigger number," said Melvin, the 64th manager in major league history with at least 1,000 wins. "I was joking in there that (executive vice president, baseball operations) Billy (Beane) is coming up on 1,700, which is a real big number.
"Bill King Day, a lot of things today that make you reflect a little bit. He was such a big part of my youth and him going into the Hall of Fame today. Unfortunately, he was not here to enjoy it and see it.
"It ended up being a nice day, and to get a win out of it that gets you a round number, it makes it a little better."
The Twins (50-52), who are in the thick of the American League wild-card race, blew a chance to gain ground on Kansas City for the second berth and to get back to .500.
"Those are tough," Twins manager Paul Molitor said. "That's three games this trip we haven't been able to close it. It just goes to show you, you can't ever take for granted the value of outs late in games and people that can handle that.
"(Rogers) has been really good. He's had a little bit of a rough trip so far. We were without (closer Brandon) Kintzler tonight, so just trying to find a way to get through it the best we could."
Daniel Coulombe (2-1) pitched a scoreless ninth for the victory
Miguel Sano hit his 24th home run of the season for the Twins. Sano hit a two-run shot off A's starter Chris Smith in the fifth inning, increasing the Twins' lead to 4-1.
Zack Granite went 2-for-4 with a two-run single with the bases loaded in the second inning. He extended his hitting streak to a career-high nine games.
A's rookie third baseman Matt Chapman hit a solo home run to deep left off reliever Buddy Boshers with two outs in the eighth, cutting Minnesota's lead to 4-3. The home run was Chapman's sixth of the season.
Rogers got the final out in the eighth but blew the save in the ninth.
"I think it was a fastball, just right over the heart of the plate for me," Davis said. "I was really looking right there, not trying to do too much.
"I was really very calm the whole day. I figured I might as well keep that approach. It was working so I tried to stay slow and easy and tried to be quick to the ball."
Smith allowed four runs and seven hits in five innings in his fourth career major league start, all coming this season at age 36. He struck out four and walked three as his streak of quality starts ended at three.
Twins rookie left-hander Adalberto Mejia allowed two runs in five innings. He gave up eight hits, struck out two, walked two and threw 97 pitches
Ryon Healy went 2-for-4 with two doubles, an RBI and a run for the A's.
The A's took a 1-0 lead in first inning when Davis launched a leadoff double to the left-center alley and Healy brought him home with a one-out double to left.
Minnesota scored twice in the second inning, grabbing a 2-1 lead. Eduardo Escobar grounded a leadoff single to right, Eddie Rosario walked and Robbie Grossman beat out a bunt to load the bases. Granite lined a two-run single to center.
"I feel like I've handled myself pretty well up here," said Granite, who was called up from Triple-A Rochester on July 7. "I'm hitting the ball decent and hopefully that can continue however long they need me."
In the fifth inning, Max Kepler hit a leadoff single and Sano lined Smith's 3-1 fastball for an opposite-field, two-run shot to right, extending the Twins' lead to 4-1.
Oakland cut Minnesota's lead to 4-2 with a run in the bottom of the fifth. Healy led off with a bloop double to right and scored when Yonder Alonso blooped a single to left with two outs.
NOTES: Oakland RHP Sonny Gray's next start was pushed back from Sunday against Minnesota to Monday against San Francisco, on the day of the non-waiver trade deadline. Gray has drawn trade interest from multiple teams, and pushing his next start back a day eliminates the possibility of an injury before the 1 p.m. PT deadline. A's RHP Jharel Cotton (right thumb blister), who had been slated to pitch Monday, will be activated from the disabled list and pitch Sunday. ... Twins CF Byron Buxton (left groin strain/migraine headaches) played his second rehab game for Triple-A Rochester and went 2-for-4 with an RBI. He's scheduled to play for Rochester again Sunday, and if all goes well he'll rejoin the Twins on Monday during their off day in San Diego, then start in center field on Tuesday night in the opener of a two-game series against the Padres, manager Paul Molitor said.