PITTSBURGH (AP) — Wade Miley spent eight masterful innings working toward his first win in nearly two months.
Two bad pitches in the top of the ninth sent him to the clubhouse. Two more by closer Addison Reed sent the Arizona Diamondbacks to another baffling loss.
Starling Marte smashed a two-run double off Reed with one out in the ninth inning and then scored on pinch-hitter Ike Davis' single two batters later to rally the Pittsburgh Pirates for a 3-2 win Tuesday night.
"I was making pitches all night long, but I didn't make them when I needed to," Miley said.
Neil Walker and pinch-hitter Gregory Polanco started the inning with singles and manager Kirk Gibson lifted Miley in favor of Reed (1-4). One batter later, Marte hit a hanging 0-2 slider off the wall in center to tie the game.
"I was trying to duplicate the previous pitch, start it on the black and have it go out of the strike zone, but I left right over the middle of the plate," Reed said. "He's a good hitter. You can't do that to him. He put a good swing on it and you saw what happened."
Andrew McCutchen was intentionally walked and Davis singled to right, scoring Marte easily.
"(Reed) threw a 92 mph cutter off the plate and I somehow hit it," Davis said.
Ernesto Frieri (1-3) earned his first win with the Pirates after working a scoreless ninth.
Miley allowed two runs on four hits in eight-plus innings, striking out 10. Miguel Montero and Aaron Hill produced consecutive RBI singles in the fifth off Pirates starter Jeff Locke. Paul Goldschmidt went 2 for 4 with a run for the Diamondbacks, who fell to 27-2 when leading after eight innings.
Pittsburgh's comeback looked unlikely most of the night the way Miley was dealing. Working both sides of the plate, he retired the first 14 batters he faced until Jordy Mercer beat out an infield single with two outs in the fifth. Russell Martin singled in the eighth and was the only other baserunner Miley allowed until the ninth.
"He was great," Gibson said of Miley. "He pitched a heck of a game. He was in total command of that game, but it didn't work out at the end. I hope to see him pitch like that again next time."
Miley came in winless in his last eight starts, including a rough four innings last week against Cleveland in which the Indians tagged him for five runs. There were no such problems for the first 24 outs against the Pirates.
"I just located tonight," Miley said. "I hadn't located in the past. That's pretty much the key right there, being able to locate and keep the ball down."
The Diamondbacks stranded nine runners in all, including six in the first four innings. They nearly squandered another scoring chance in the fifth before being bailed out by some sloppy defense by the Pirates.
Goldschmidt singled with two outs and was attempting to steal second when the Pirates sniffed it out. Locke threw to Gaby Sanchez at first to start the rundown, but the burly Goldschmidt was safe at second when Sanchez's throw to Mercer sailed into left field.
Montero followed with a single that brought Goldschmidt home, and Montero scored moments later on Hill's flare to shallow right.
Given a lead, Miley didn't let it go to waste. He struck out the side in the seventh and had little trouble in the eighth.
Arizona nearly went ahead 3-0 in the ninth, only to have Gerardo Parra thrown out at home trying to score on a single to right by Ender Inciarte. Less than 15 minutes later, the Pirates were celebrating their second win in 35 games when trailing after eight innings.
"Every time we're up to bat there's a chance we do something," Davis said. "It's hard to shut us down for nine. We've done it a lot this year ... anything is possible with us."
NOTES: Pirates LHP Francisco Liriano is scheduled to pitch four innings in a simulated game Wednesday. Liriano, on the disabled list with a strained left oblique, threw 52 pitches without an issue in the bullpen on Sunday. ... An MRI on Arizona SS Chris Owings' left shoulder Monday revealed no structural damage. Owings went on the disabled list Sunday with a left shoulder strain. Gibson called the injury just a bruise. Owings won't hit for about a week, but Gibson is confident the rookie will be able to return when his 15-day stint on the DL is up. ... The series continues Wednesday when Arizona's Chase Armstrong (5-3, 3.63 ERA) faces Pittsburgh's Charlie Morton (4-9, 3.41).