BALTIMORE -- The Baltimore Orioles used their speed to help open a lead against the Oakland A's on Sunday.
Then they used their power to close out the victory.
J.J. Hardy hit his 23rd homer and added a double and a single as the Orioles pounded out 13 hits to take the finale of a three-game series with Oakland by beating the A's 10-3 on Sunday.
The Orioles (70-59) took two of three to pull within two games of the A's (72-57) in the race for the second AL wild-card spot.
"Coming into today, (there's) not many days when I go 'we need to play well today and see if we can get a W.' This is one of those days," Baltimore manager Buck Showalter said.
Nick Markakis and Nate McLouth added a homer and double apiece and the Orioles scored three of their first six runs on sacrifice flies, including two by Manny Machado.
"We were swinging the bat well," Machado said. "It's been awhile since we went out there and scored so many runs like that, hit the ball well and made some runs instead of just hitting home runs."
Orioles starter Scott Feldman (4-3) pitched five innings, giving up a run and three hits, all singles. He struck out six, but walked four and hit a batter.
Josh Donaldson hit a two-run homer in the eighth and Jed Lowrie had two hits for Oakland, which dropped to 9-14 since July 30.
Feldman, acquired July 2 from the Cubs, began the day with a 6.52 ERA in five home starts for Baltimore and struggled early on.
"It wasn't the prettiest outing. It was a battle from the get-go. You never feel good only going five, but in a case like today, we were able to get the win," Feldman said.
"T.J. came in and picked me up. The offense swung the bats great," Feldman added. "Guys made some big plays out there on the field. Any time you get a win and keep the damage off the board, you have to feel good about it."
A balk sandwiched between two walks put A's on first and third with one out in the first. Feldman fanned Brandon Moss, but Alberto Callaspo blooped a single just beyond the reach of second baseman Ryan Flaherty in right to score Coco Crisp to make the score 1-0. Feldman fanned Seth Smith to end the inning.
"You know what, there's always that catch-22 where you make him work and you make him throw some pitches and now you get some pitches to potentially do some damage. We just didn't do that," A's manager Bob Melvin said.
The Orioles responded quickly after the A's struck early. Consecutive one-out singles in their half of the first inning by Machado, Chris Davis and Adam Jones off Oakland starter Sonny Gray (1-2) tied the game.
Baltimore took a 2-1 lead when Davis scored on a sacrifice fly by Matt Wieters.
The Orioles added three runs in the second. Hardy doubled and, after Flaherty walked, Brian Roberts blooped a single to left scoring Hardy. With runners on first and second, McLouth flied to deep left center and both runners tagged up, with Flaherty going to third.
Flaherty scored and Roberts went to third when Machado followed with a deep fly to left center. Davis then hit a sharp single to left scoring Roberts to give the Orioles a 5-1 lead.
"We ran the bases real well and took advantage of what might be there for us," Showalter said.
The Orioles added runs on Machado's sacrifice fly in the fourth and Hardy's solo homer leading off the sixth.
In the eighth, Markakis led off with a solo shot and McLouth added a two-run homer with two outs.
Gray, who came in with a 1.71 ERA in four starts since being recalled from Triple-A Sacramento, was finished after 3 1/3 innings. He gave up six runs on eight hits.
"I felt good," Gray said. "My stuff has been better. I just didn't make a lot of pitches that I needed to. They weren't really hitting the ball that hard, but they were finding holes. It wasn't our day and it started with me in the first inning."
NOTES: Markakis' fourth-inning double was his first extra-base hit over a 31-game stretch. ... A's RF Josh Reddick left in the sixth inning with an injured right wrist. ... Oakland's Yoenis Cespedes was given the day off. He was 0-for-8 (five strikeouts) in the first two games of the series. ... Oakland RHP A.J. Griffin (10-9, 3.84) pitches against Annibal Sanchez (11-7, 2.45) Monday in Detroit. ... Baltimore begins a three-game series Tuesday in Boston. ... Showalter said RHP Jason Hammel (DL since July 29 with right flexor mass strain) is slated for a rehab assignment Thursday at Double-A Bowie.