The Pittsburgh Pirates had celebrated too early, first when reliever Yohan Ramirez used an upside-down orange traffic cone to catch a Marcell Ozuna home run in the bullpen and then after two blasts by Brandon Lowe to build a comfortable cushion over the Philadelphia Phillies.

Kyle Schwarber was ready to serve as the spoiler to that storyline when the MLB home runs leader came to bat with one out and the bases loaded in the top of the ninth. Schwarber, who had homered twice, drew a bases-loaded walk off Gregory Soto, and Bryce Harper drove in the tying runs with a single off the right-center wall.

The Phillies pulled away with four consecutive hits off Dennis Santana in the 10th inning, when Brandon Marsh doubled off the Clemente Wall to drive in automatic runner Alec Bohm for the lead and Rafael Marchan hit a two-run single to seal what Lowe called a “punch in the gut.”

The Pirates’ bullpen blew a five-run lead in an 11-9 loss to the Phillies on Friday night before 29,998 at PNC Park, a disappointing defeat to open the three-game series and one that confirmed serious concerns about the ineffectiveness of their closer-by-committee pairing.

“It’s a tough loss. Any loss is tough, especially when you have a lead like that,” Pirates manager Don Kelly said. “It’s going to happen throughout the season and, again, talking about bouncing back. We need to find a way to put this one behind us.”

Pirates starter Braxton Ashcraft (3-2) was efficient in striking out five without a walk while allowing four runs on seven hits in throwing 76 strikes on a career-high 100 pitches over 6 2/3 innings. Phillies starter Aaron Nola lasted only 3 2/3 innings, getting pulled after giving up six runs in the third inning.

Schwarber continued his hot streak by going 3 for 5 with five RBIs and is batting .353 (12 for 34) with nine homers and 15 RBIs over his last eight games. It was his second multi-homer game in that stretch and third of the season. Harper went 4 for 5 with two RBIs.

“Schwarber is on an absolute tear,” Kelly said. “What’s it, nine homers in eight games or something? He’s a heck of a hitter. He got Ashcraft, he got Mason. He’s swinging the bat well, and so is Harper behind him.”

The Pirates killed scoring chances in the first two innings. Oneil Cruz drew a leadoff walk in the first inning but was caught stealing second base. Ryan O’Hearn drew a leadoff walk in the second, but rounded second base on Ozuna’s fly ball to the left-field warning track and was victim of a 7-4-3 double play.

The Pirates’ fortunes changed in the third, when they scored six runs on five hits as Nola endured a 39-pitch inning. Konnor Griffin reached on an infield single, Endy Rodriguez drew a full-count walk and both runners advanced on Jared Triolo’s grounder to third baseman Alec Bohm. First-base umpire Mike Muchlinski called Triolo safe, but the Phillies challenged the call and it was overturned upon review.

Cruz hit a jam-shot single to center to drive in Griffin and Rodriguez for a 2-0 lead. Lowe followed by drilling a 2-1 fastball 378 feet to the right-field seats for his 11th home run and a 4-0 lead. After Bryan Reynolds singled to center, Ozuna hit a full-count fastball 438 feet into the home bullpen in left-center where Ramirez’s catch set off a celebration.

The six runs in the third were the most by the Pirates in an inning against the Phillies since an eight-run ninth in a 15-2 win at Philadelphia on Sept. 15, 2016.

The Phillies answered with back-to-back singles by Harper and Bohm. Harper advanced to third when Marsh grounded into a forceout at second base and scored on a sacrifice fly by Bryson Stott to cut it to 6-1.

Schwarber sent Ashcraft’s 2-1 fastball 400 feet to right-center for a two-out, two-run shot for his 19th home run as the Phillies made it 6-3 in the fifth.

But Lowe responded by driving lefty Tim Mayza’s 0-1 slider 422 feet to right-center for his 12th home run to lead off the fifth and give the Pirates a 7-3 advantage. It was his third multi-homer game of the season.

The Pirates took advantage of two Phillies errors to add another run in the sixth. Spencer Horwitz hit a leadoff single, stole second base and advanced to third on an error by catcher Garrett Stubbs, then scored for an 8-3 lead when Bohm booted a Triolo grounder to third.

When Ashcraft got Trea Turner to ground into a forceout for the second out of the seventh, the Pirates brought in lefty Mason Montgomery. Schwarber sent his first pitch, a 96.7-mph fastball down the middle, 408 feet and over the North Side Notch for another two-run homer — his major league-leading 20th — to cut the Pirates’ lead to 8-5.

“I don’t know if I’ve ever a ball hit like that off Monty,” said Lowe, who also played with Montgomery in Tampa Bay. “You kind of tip your cap to a guy like that when he’s swinging the bat the way he is right now and the way that he has. As a baseball fan it’s fun to watch. As a competitor it kind of stinks.”

Soto entered in the ninth, only for Edmundo Sosa to reach on a fielding error when Griffin bobbled it, and pinch hitter Adolis Garcia walked. Turner singled to right to load the bases for Schwarber, who drew a four-pitch walk to cut it to 8-6. Harper’s two-run single tied the game, but Schwarber was thrown out at third and Bohm flied out to right to end the rally.

In the bottom of the ninth, Reynolds hit a two-out single through the middle, then got into scoring position by stealing second base. But Jose Alvaradio struck out O’Hearn to send the game into extra innings.

After the Phillies took a three-run lead in the 10th, the Pirates scored when Griffin grounded out to third to drive in automatic runner O’Hearn to cut it to 11-9, but Orion Kerkering struck out Rodriguez to end the game and earn the save.

“You know there’s games that you feel like you lose and there’s games you feel like you get beat,” Ashcraft said, “and this is definitely one that we lost.”