OAKLAND -- Yoenis Cespedes homered twice and tied a career high with five RBIs before leaving with an apparent right thumb injury, and the A's held off the Houston Astros 9-7 on Wednesday at O.co Coliseum.
The two-time reigning Home Run Derby champion hit a three-run drive in the second inning and a two-run shot in the fourth off Brad Peacock (3-7) for his 15th and 16th homers this season. Cespedes snapped a 25-game skid -- matching his career high -- since his last long ball June 19 against Boston.
Cespedes was replaced in left field with the A's leading 8-1 in the seventh. But the Astros almost pulled off an improbable comeback, scoring five runs in the eighth before the back of Oakland's bullpen shut them down.
Jesse Chavez (8-6) allowed two runs and four hits in 5 2-3 innings to help the A's (62-38) extend the best record in baseball. He struck out seven and walked two.
Struggling reliever Jim Johnson gave up four runs -- three earned -- without recording an out to spark Houston's five-run eighth. He left to a smattering of boos again.
Luke Gregerson stranded two runners on base in the eighth, and Sean Doolittle recorded his 15th save in 18 tries with a perfect ninth.
Chavez, who had not started since July 12 at Seattle before the All-Star break, looked sharp at the outset. He did not allow a hit until Matt Dominguez lined a single to left with one out in the fifth.
The A's got all the support they needed in just three swings.
Jed Lowrie led off Oakland's second with his fifth homer, and Cespedes busted the game open by sending a slider from Peacock over the wall in center. In the fourth, Cespedes pulled a curveball into the stands in left to put the A's up 7-0.
It was Cespedes' fifth career two-homer game and first since June 4 at the New York Yankees. It also was the third time he's had five RBIs in a game -- all this year.
Peacock, who was traded to Houston in February 2013 as part of the deal that landed Lowrie in Oakland, was charged with seven runs and seven hits in 3 2-3 innings.
The A's built leads of 8-1 and 9-2 but still had a few scares late.
Cespedes had his right thumb examined by a team trainer after grounding out on an awkward swing in the fifth. He stayed in the game before Craig Gentry replaced him in left field to start the seventh.
First baseman Brandon Moss had his left hand looked at by a trainer after Jose Altuve ran through his tag on a misfired throw, jarring the ball loose, and Johnson -- who signed a $10 million, one-year deal with Oakland after leading the AL with 50 saves for Baltimore last season -- helped turn a runaway game into a tight one.
NOTES: Athletics INF Alberto Callaspo (right hamstring) could begin a rehab assignment in the next day or so and come off the disabled list Sunday. ... The Astros placed rookie OF George Springer on the 15-day disabled list with a strained left quadriceps and recalled outfielder Marc Krauss from Triple-A Oklahoma City. ... The A's said they raised $29,189 for Juvenile Diabetes Research Foundation during the team's annual Root Beer Float Day, bringing the 15-year total to more than $414,000. ... Jeff Samardzija (1-1, 3.27 ERA) takes the mound for Oakland against Scott Feldman (4-7, 4.30 ERA) and the Astros in Thursday's series finale.