Nick Markakis capped a three-run rally in the seventh inning with an RBI single that lifted the Baltimore Orioles to a 9-7 win over the visiting Oakland Athletics in the opener of a three-game set between playoff contenders.
Nate McLouth's leadoff walk helped set the stage for Baltimore, which closed to within two games of the A's for the second wild-card spot in the American League.
Ryan Cook (5-3) replaced Jesse Chavez following the free pass to McLouth. Chavez didn't allow a hit over 2 2/3 innings in relief of starter Dan Straily, who is winless in his last seven outings (0-5).
Manny Machado greeted Cook with a single and McLouth scored when Chris Davis hit a one-hopper off the glove of Eric Sogard. The second baseman had given Oakland a 7-6 lead with a two-run single in the fifth.
Machado went to third on the error and scored the go-ahead run on Adam Jones' dribbler down the third-base line. After Matt Wieters legged out a slow roller to third, Markakis plated Davis with a base hit to center field.
Tommy Hunter pitched around a Coco Crisp single in the top of the eighth and Jim Johnson, with the help of a stellar defensive play by Machado at third base, tossed a perfect ninth for his 40th save of the season. The Baltimore closer had blown his previous three save opportunities.
"We know what we have to do and we know what lies in front of us," Johnson said.
The O's scored in only one other inning, with Brian Roberts supplying a grand slam in a six-run fourth.
Baltimore starter Bud Norris allowed seven runs on nine hits and three walks in 4 2/3 innings, while Francisco Rodriguez (2-0) was credited with the win after retiring the A's in order in the top of the seventh.
Crisp finished with four hits for the Athletics, who have dropped three in a row to fall 3 1/2 games back of first-place Texas in the AL West.
"We put up runs like that, we usually win those games, and we just couldn't hold them down," said Oakland manager Bob Melvin.
Brandon Moss singled home Crisp with two outs in the first. Crisp and Moss both took Norris deep in the third for a 3-0 Oakland lead.
Straily held the Orioles hitless through three innings before being chased in the fourth.
Jones followed a leadoff walk by Davis with a home run to right field. Baltimore eventually loaded the bases and Roberts cleared them with a drive to right for his sixth career grand slam.
Norris, however, failed to protect his newfound lead as the A's countered with a four-spot in the fifth to move back in front.
Jed Lowrie doubled home Crisp and scored on a Josh Donaldson single. After Moss lined into a double play, Norris issued two walks around a Seth Smith single. Troy Patton inherited the bases-loaded situation and surrendered the hit by Sogard. Crisp popped out with the bags full again to end the frame.