PITTSBURGH (AP) Pedro Florimon tripled home Francisco Cervelli with two outs in the bottom of the 15th to lift the Pittsburgh Pirates to a 9-8 win over the Arizona Diamondbacks on Tuesday night.

Cervelli singled off Keith Hessler (0-1) for his fourth hit and Florimon hit a high flyball to right field that clanged off the wall. The Pirates catcher had little trouble beating the throw to the plate with a tumbling slide, ending Pittsburgh's longest game of the season.

Joe Blanton (5-2) pitched three innings of scoreless relief for the Pirates. Starling Marte and Jung Ho Kang homered for Pittsburgh, which won despite blowing a late five-run lead.

More from FoxSports

Paul Goldschmidt drove in two runs and tied the game off Pittsburgh closer Mark Melancon in the ninth. Aaron Hill had three hits for Arizona, which left 11 runners on base.

Melancon's club-record consecutive save streak ended at 35 with more than a little help from his defense. He entered with a two-run lead in the ninth but the Diamondbacks rallied to tie it. Ender Inciarte hit a grounder that rolled under Kang's glove at third base to start the inning.

Hill singled two batters later and Goldschmidt hit a hard grounder right at first baseman Sean Rodriguez. The ball deflected off Rodriguez and into the right-field corner, allowing two runners to score for Melancon's first blown save since April 21.

Pittsburgh had a chance to win it in the ninth. Andrew McCutchen led off with a single and was on second when Kang lined a shot to Goldschmidt's left at first. The burly first baseman lunged for the ball and fired to second to double up McCutchen, leading the normally even keeled Kang to throw his batting helmet in the dugout in disgust, sending a tub of bubble gum flying.

Pittsburgh came in 9-0 in Francisco Liriano's previous nine starts since he was on the other side of the no-hitter thrown by Max Scherzer on June 20, even if Liriano hasn't exactly been dominant during the run.

He began the night with an ERA of 7.00 this month, a number that appeared to be heading north after he gave up three consecutive singles and a walk to start the game, yielding three runs during Arizona's first trip through the order.

Liriano rediscovered his command after that, retiring 13 straight at one point, giving the Pirates time to get to Arizona starter Chase Anderson. Marte led off the third with a home run to the Arizona bullpen in center, his first in 39 games, to put Pittsburgh in front 4-3. Anderson then unraveled in the fifth.

Ramirez and Kang singled with two outs and Neil Walker followed with a walk to load the bases. Alvarez delivered a two-run single up the middle to make it 6-3 and Cervelli tacked on another run with a run-scoring single of his own. Kang pushed the lead to 8-3 when he tucked a homer into the seats in left field in the seventh.

Liriano came out for the eighth but left after giving up a single and a walk to start the inning. Reliever Jared Hughes couldn't get an out and was later charged with the first run given up by Pittsburgh's bullpen in 13 2-3 innings. Tony Watson helped the Pirates escape still in front 8-6, setting the stage for Melancon before Pittsburgh' defense came undone.

TRAINERS'S ROOM

Pirates P A.J. Burnett is making small strides while he works his way back from a strained flexor tendon in his right (throwing) elbow. The 38-year-old Burnett will begin working off an incline in front of the pitcher's mound as he attempts to regain strength. Manager Clint Hurdle said Burnett will steadily move his way up the incline in the coming days if there are no setbacks.

UP NEXT

Arizona's Robbie Ray (3-8, 3.29 ERA) looks for his first victory in nearly six weeks on Wednesday when the teams wrap up the three-game series. Ray has dropped four straight decisions since beating Texas on July 7 even though he hasn't allowed more than four earned runs in any of his last six starts.

J.A. Happ makes his third start for Pittsburgh since arriving from a trade with Seattle. Happ is 0-1 with a 4.66 ERA with the Pirates and 4-7 with a 4.64 ERA on the season.

---

Follow Will Graves at www.twitter.com/WillGravesAP