Kyle Gibson pitched into the seventh inning in his Phillies debut and got plenty of support as Philadelphia avoided a series sweep by pounding the Pittsburgh Pirates 15-4 on Sunday.

J.T. Realmuto got five of the Phillies' 20 hits, with two doubles and four RBIs. Bryce Harper hit three of Philadelphia's nine doubles and Jean Segura doubled twice and drove in three runs.

"It was a lot of fun," Gibson said. "There's nothing like pitching in a pennant race and being on a team that's fighting every single day to get to where you want to be."

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

The Phillies got Gibson (7-3) and pitcher Ian Kennedy from Texas in a deadline deal Friday for rookie right-hander Spencer Howard and two other pitching prospects. A first-time All-Star this season, the 33-year-old righty had lost his last three starts for the Rangers, giving up 15 earned runs on 22 hits and 12 walks in 17 1/3 innings.

But Gibson looked fine against the Pirates, allowing two runs on five hits and striking out five in 6 2/3 innings. He retired the first eight batters before walking Pirates pitcher Mitch Keller in the third.

The Phillies, who had lost four of five, are 3 1/2 games back of the first-place New York Mets in the NL East.

"I thought it was really important that we won today's game," Philadelphia manager Joe Girardi said. "To come out and be able to put that many hits together, and runs came up and down the lineup, was really important for us moving forward."

Pittsburgh is 0-8 with a chance to sweep this season.

"We haven't been able to finish one," Pirates manager Derek Shelton said. "Winning the first two games of a series is really good. We have to figure out a way to finish it."

Realmuto had a two-run single as the Phillies scored five times in the eighth on two hits and five walks for a 13-2 lead. They tacked on two more runs as Pirates first baseman John Nogowski pitched the ninth.

"We had a conversation before the game about, as an offense, maybe we were just pressing too much," Realmuto said. "So, we just talked today about having fun. It sounds silly, but it's having fun and not putting too much pressure on yourself."

Harper and Realmuto each scored three times and Didi Gregorius had three hits and drove in three runs. Harper doubled in three straight plate appearances — it was his first three-double game since 2018 for Washington against the Phillies.

Keller (3-8) allowed four runs in five innings during his first start in the majors since June 10 following a stint with Triple-A Indianapolis.

"Obviously, the results weren't there," Keller said. "I mean, five innings with four (runs allowed) is not ideal. ... I think I executed a lot of good fastballs. I felt really good, confident. Just think in the first and second innings, my breaking-ball stuff was just up in the zone."

After retiring 11 of 12 batters, Gibson gave up a double to Hoy Park with one out in the seventh. It was Park’s first major league hit. Gibson was pulled when Park scored on a sacrifice fly from Kevin Newman, cutting it to 8-2.

Michael Perez hit a two-run homer with two outs in the Pirates ninth.

TRAINER’S ROOM

Phillies: OF Andrew McCutchen had an MRI on Sunday after leaving the game Saturday with a knee injury, Girardi said. It's uncertain if McCutchen will go on the injured list.

Pirates: LHP Steven Brault will return to Pittsburgh this week. He has been on the 60-day injured list with a left lat strain since April 1.

UP NEXT

Phillies: LHP Ranger Suárez (5-3, 1.12 ERA) will take the mound Monday for the first of a four-game series at Washington. Suárez will move to the rotation after allowing nine runs (five earned) in 40 1/3 innings out of the bullpen this season.

Pirates: RHP Bryse Wilson (2-3, 4.83) will make his Pittsburgh debut Monday, starting the first of a three-game set against the Milwaukee Brewers. Wilson was acquired from the Atlanta Braves on Friday as part of a package for RHP Richard Rodriguez.