In keeping with the theme of the game Tuesday night, the Pirates did their work in the ninth inning quickly. After eight scoreless innings passed in rapid fashion at the hands of Arizona Diamondbacks starter Wade Miley, the Pirates upended the contest in a flash.

Ike Davis’ pinch-hit single gave the Pirates a 3-2, walk-off win against the Diamondbacks at PNC Park. The Pirates won for the eighth time in their past 10 games and stole one from the Diamondbacks after Miley punished them for eight innings.

“We’ve had a couple taken from us this year, so it just happens,” Davis said. “We’re going to battle until the game’s over. Obviously, going from a good chance of losing to winning is always a great thing.”

Neil Walker and pinch-hitter Gregory Polanco, initially given the night off, singled to start the ninth with the Pirates trailing, 2-0. Polanco had been 0 for 16 against left-handers since hitting his first career homer off Miami Marlins left-hander Mike Dunn in a 13-inning Pirates win June 13.

“From my perspective down there, he’s probably our best reach guy,” manager Clint Hurdle said. “There’s some thought, ‘Well, you send a guy up there that’s done it.’ This kid’s talented.”

Diamondbacks manager Kirk Gibson replaced Miley with closer Addison Reed. Josh Harrison lined out. Starling Marte swung and missed at two sliders, but connected with the third, driving it off the wall in center for a two-run, tying double.