MIAMI (AP) — Pablo Lopez allowed one run in seven innings with the help of flashy defense by right fielder Matt Joyce, and the Miami Marlins won Game 7 of their marathon series against Philadelphia on Monday, 6-2.

The series, the majors’ longest in the regular season in 53 years, included three makeup games and two doubleheaders. The Marlins won five of the seven games, including the final three, to move into second place in the NL East, 1 1/2 games ahead of Philadelphia.

Lopez (4-4) bounced back from his worst outing of the year by allowing only three hits and retiring his final 13 batters. He was helped by not one but two over-the-shoulder basket catches on the warning track by a retreating Joyce, who robbed Scott Kingery and Jean Segura.

The only run Lopez allowed came on Andrew McCutchen’s seventh homer to start the game. Philadelphia totaled four hits without J.T. Realmuto and Rhys Hoskins, both nursing injuries.

Jesus Aguilar put the Marlins ahead with a two-run double in the third. Miguel Rojas hit his third home run and Starling Marte added his fifth, both off David Phelps.

Kingery, reinstated from the injured list before the game, hit his second homer. Phils catcher Rafael Marchan made his major league debut and went 1 for 3.

Vince Velasquez (0-1) allowed four runs in 3 2/3 innings, and his ERA rose to 6.46.

TRAINER’S ROOM

Phillies: C Realmuto (hip) and 1B Hoskins (left wrist) were both out of the lineup for a second day in a row. … RHP Zack Wheeler (finger) threw a bullpen session before the game. … LHP Ranger Suarez was optioned to Lehigh Valley.

Marlins: 2B Isan Diaz left the game in the fourth inning with a tight left groin.

UP NEXT

Phillies: RHP Jake Arrieta (3-4, 5.54 ERA) is scheduled to start when the Phillies return home Tuesday to face the New York Mets.

Marlins: They continue their 15-game homestand with a three-game series against Boston. RHP Sandy Alcantara (2-1, 3.97 ERA) is scheduled to start Tuesday.