OAKLAND, Calif. -- When Yoenis Cespedes crushed a two-run homer in the bottom of the first inning off right-hander Justin Masterson, the Oakland A's had to like their chances for a no-stress win on Friday night.
As it turned out, the A's had to grind out a 3-2 victory in a game that wasn't safely in hand until closer Grant Balfour got Asdrubal Cabrera to line into a double play with one out and runners on first and second in the ninth.
The Indians left 13 runners on base. A's pitchers issued nine walks, five of those from starter A.J. Griffin, who gave up just one unearned run but lasted only five innings.
A's relievers Dan Otero, Sean Doolittle, Ryan Cook and Balfour took over from there, giving up one run despite four more walks and four more Indians hits.
"You can't say enough about the way our pitching staff battled tonight and just made pitches when they had to," A's catcher Stephen Vogt said.
The A's pulled to within one-half game of first-place Texas in the American League West and Cleveland remained 6 1/2 games behind Detroit in the American League Central. Oakland beat Cleveland for the first time this season after being swept by the Indians in a four-game series in May at Progressive Field.
"It is a tough lineup. It's a huge win," Griffin said. "Those are the type of teams we're going to be facing down the stretch. We feel good about ourselves. We feel like we can win games."
Masterson (13-9) allowed three runs and seven hits in 7 2/3 innings but took the loss. He struck out four, walked one and paid a high price for a handful of mistakes.
"I hung a slider early to Cespedes, one of those where he hit it really, really well. Just kind of flipped it in there," Masterson said. "Aside from that, I didn't feel the greatest, but I was able to get nice ground balls, a lot of movement on my pitches."
The Indians scored a run in the third and pulled even with a run in the seventh when Drew Stubbs hit his second double of the night, moved to third on a sacrifice bunt and came home on Nick Swisher's single.
But the A's answered with a run in the bottom of the seventh to regain the lead. Vogt lined a single to right with two outs. Sogard rifled a double down the right-field line and Vogt scored all the way from first as second baseman Jason Kipnis' relay throw home went too far up the third-base line.
"I didn't know what happened. I just knew the ball was in right field, so I just put my head down and started running," Vogt said. "(Third base coach Mike Gallego) kept waving me so I kept going.
"I can run a little bit. I played a lot of outfield coming up through the minor leagues, so I've always been able to run a little bit for the stereotypical catcher."
Griffin allowed four hits but threw 104 pitches. He walked five, one from his career high, which he set in his previous start against Toronto and received a no-decision.
"Early on, he was really having a tough time finding the zone, and besides driving his pitch count up, we didn't have much to show for it on the scoreboard," Indians manager Terry Francona said.
"They have a talented bullpen. Normally when you get to the starter, when you get that many pitches in the fifth, you feel pretty good about yourself. They have some depth in that bullpen."
Otero pitched a perfect sixth inning, but Cleveland pulled even at 2-2 in the seventh with a run against left-hander Doolittle, who got the win. Cook pitched a scoreless eighth. He gave up a two-out double to Stubbs and walked Michael Bourn but got Swisher to ground out.
Balfour pitched a scoreless ninth for his 31st save of the season, but it wasn't easy. With one out, Carlos Santana walked and Michael Brantley sliced a single to left, moving pinch0runner Mike Aviles to second. Cabrera followed with a line drive, but third baseman Josh Donaldson gloved it, threw to Sogard at second to double off Aviles, ending the game.
"Tonight we hit a lot of balls hard, just happened to be right at people," Masterson said.
NOTES: Oakland CF Coco Crisp (strained left wrist) was out of the lineup for the fifth straight game. He had a cortisone injection on Tuesday, but A's manager Bob Melvin said Crisp's injured wrist was still "pretty stiff." ... A's C John Jaso (concussion), who has been on the disabled list since July 25, said he won't be able to return until the first week of September at the earliest and has no guarantee of playing again this season. Jaso was examined Tuesday in Pittsburgh by Dr. Michael Collins, a concussion specialist. Jaso said Collins told him he would eventually recover fully but didn't know whether he would recover in time to play again this season.... Indians RHP Carlos Carrasco returned to the bullpen after making a spot start on Wednesday against Minnesota.