MIAMI (AP) — J.T. Realmuto homered twice against his former team, Bryce Harper also went deep and the Philadelphia Phillies beat the Miami Marlins 6-1 on Wednesday night.

Philadelphia holds the second NL wild-card spot by 2 1/2 games after third-place San Diego lost earlier at Seattle.

“Even though I’m not worried about the standings, I feel this team is in a good place the way we’re playing the game right now,” Realmuto said. “The guys are jelling. It’s a lot of fun.”

Kyle Gibson (10-6) threw six innings of one-run ball. The right-hander gave up six hits, struck out seven and reached double-digit victories in a season for the seventh time in his career.

“Any victory I get probably has to do with the offense doing really well and the defense playing good defense,” Gibson said. “It’s cool to be able to pile those up and maybe something to look back at the end of your career and see where you finished up.”

Harper, the reigning NL MVP, hit his 100th homer with the Phillies.

Advertising

For the second straight night, the Phillies spotted Miami a run before they erased the deficit with homers. Harper and Realmuto hit consecutive shots in the sixth against starter Edward Cabrera.

Harper’s drive over the wall in left-center field tied it 1-all, and Realmuto’s go-ahead homer to center chased Cabrera.

“It’s been a struggle trying to get it going,” said Harper, who hit his second homer since returning from the injured list Aug. 26 after a two-month absence because of a broken thumb. “I was just trying to hit a pitch over the plate and get us going right there.”

Jean Segura’s RBI double off Marlins reliever Richard Bleier in the sixth made it 3-1.

Realmuto, who played with the Marlins from 2014-18, connected again in the seventh with a three-run shot that padded Philadelphia’s lead. He has 22 RBIs in his last 21 games and has homered four times against Miami this season.

The Phillies won their fifth consecutive series over Miami and will seek a second straight road sweep against their NL East opponent Thursday night. The Marlins are 15-37 since getting swept at home by the Phillies from July 15-17.

Advertising

“Winning any series is good but I’ve said it all along — their pitching is so good that it’s tough to beat them in a series,” Phillies interim manager Rob Thomson said.

Cabrera (5-3) overcame a 33-pitch first inning and limited Philadelphia to one hit until the homers by Harper and Realmuto. He walked three, struck out four and hit two batters with pitches in 5 1/3 innings.

“He recovered and really got himself into a good spot,” Marlins manager Don Mattingly said. ”He hung in there.”

JJ Bleday gave the Marlins an early lead with his two-out RBI single in the first. Bleday’s line drive to right scored Brian Anderson from second. Trail runner Nick Fortes got caught between second and third but was tagged out after Anderson crossed the plate.

A night after going hitless in his major league debut, Marlins infielder Jordan Groshans singled in the second and finished 3 for 3.

“It was a big relief. It felt like the world was off my shoulders,” Groshans said.

Advertising

NEW ROLE

A fixture in the Phillies’ rotation for seven seasons, Zach Eflin relieved and threw a perfect eighth. Eflin had been sidelined since June 26 because of a right knee injury and was activated from the injured list Monday.

“There was a lot of uncertainty, a rough three months for me,” Eflin said. “I finally found myself in a position to pitch a week ago and here we are. I feel better than I ever have.”

ROSTER MOVE

The Phillies claimed RHP Tayler Scott off waivers from San Diego and optioned him to Triple-A Lehigh Valley. LHP Kent Emmanuel was recalled from Lehigh Valley and placed on the 60-day injured list because of a left shoulder strain.

TRAINER’S ROOM

Phillies: Thomson said X-rays on slugger Rhys Hoskins’ right hand were negative after he left the game when he was hit by a changeup from Cabrera in the third. Hoskins ran the bases but was removed in the bottom half. … OF Nick Castellanos (right oblique strain) didn’t take batting practice but worked on defensive drills.

Marlins: INF Joey Wendle (soreness) sat out for the second consecutive game.

UP NEXT

Phillies RHP Noah Syndergaard (9-9, 4.09 ERA) pitches Thursday night against Pablo López (8-10, 4.04).

___

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP_Sports