PHILADELPHIA (AP) — Jose Fernandez looked strong again, but the Miami Marlins couldn't turn it into a victory.

Jeff Francoeur hit a pinch-hit three-run home run in Philadelphia's four-run eighth inning, leading the Phillies to a 6-3 victory Friday night in a matchup of two of the worst teams in baseball.

J.T. Realmuto homered and Justin Bour had two hits for the Marlins, whose 38-51 mark entering the game was only better than Milwaukee and the Phillies.

Fernandez, Miami's ace, looked good in his third start since returning from Tommy John surgery. The right-hander, who won his first two starts, gave up two runs and four hits in six innings with six strikeouts and one walk. Fernandez's ERA rose slightly, from 2.08 to 2.37.

"I just tried to give my team a chance to win every time out, and I'm glad I'm healthy again," he said.

Fernandez was cruising along through five scoreless innings of one-hit ball with six strikeouts before Phillies starter Adam Morgan doubled leading off the sixth for his first career hit. Morgan went to third on Ben Revere's bunt single. Third baseman Casey McGehee appeared to have the best chance to field the ball and possibly get Revere out, or at least hold Morgan at second, but he retreated to the bag.

"That's a play that has to be made," Miami manager Dan Jennings said.

Morgan scored when Maikel Franco grounded into a double play.

The Phillies got some help from Miami in the pivotal eighth inning.

Cole Gillespie dropped Franco's line drive to center field, and Odubel Herrera scored to give the Phillies a 3-2 lead. Herrera had led off the inning with a pinch-hit single off Bryan Morris (3-2) and went to second on Revere's sacrifice bunt. Morris was lifted after walking Cesar Hernandez, and Carter Capps got Franco to line to center. It should have been the second out, but the ball deflected off Gillespie's glove as he reached for it.

"It looked like the ball was knuckling a little," Jennings said. "He's a tremendous outfielder. It was just one of those things."

Francoeur then broke the game open with his first career pinch-hit homer off Mike Dunn.

"He's been a special guy for us," Philadelphia interim manager Pete Mackanin said. "Great energy. Loves playing baseball and I think it rubs off on the rest of the guys. I'm happy to see it."

Ken Giles (4-2) pitched a scoreless eighth inning to earn the victory.

Closer Jonathan Papelbon, the lone Phillies All-Star, gave up Realmuto's homer while pitching in a non-save situation in the ninth. Papelbon drew boos from the crowd upon his entrance, and louder boos after the homer and subsequent single to Ichiro Suzuki. He made comments during the All-Star break criticizing Phillies management for failing to trade him, saying they should "you know what or get off the pot."

Mackanin said he could understand the fans' reaction.

"Without a doubt," Mackanin said. "He says a few things he shouldn't say and it comes across poorly sometimes."

Ryan Howard had an RBI for the Phillies, who snapped a five-game losing streak while winning for just the eighth time in their last 34 games. Philadelphia set a franchise record with 62 losses before the All-Star break.

Morgan, making his fourth career start, rebounded from his worst outing by allowing two runs and four hits in 6 1-3 innings. Morgan walked three and struck out three.

Howard gave the Phillies a 2-1 lead with an RBI single that scored Revere.

Miami tied it in the seventh on Gillespie's RBI double off Luis Garcia.

The Marlins took the lead in the fourth on Bour's RBI single to center that opened the scoring.

CALLING ON NOLA

The Phillies announced before the game that RHP Aaron Nola will make his major league debut on Tuesday against Tampa Bay. Nola was Philadelphia's first-round draft pick last season, making him the first Phillies player since Pat Combs in 1989 to debut in the majors the year after he was drafted.

WALK THIS WAY

McGehee tied his career-high with three walks.

TRAINER'S ROOM

Marlins: The Marlins placed All-Star 2B Dee Gordon (dislocated left thumb) on the 15-day DL. Gordon was hurt sliding headfirst last Saturday. The Marlins activated Martin Prado (right shoulder) from the DL. Prado batted second and played second base, going 0 for 4.

UP NEXT

Marlins RHP Tom Koehler (7-5, 3.40 ERA) opposes Phillies RHP Chad Billingsley (1-3, 6.75) in the second game of the three-game series on Saturday night. Billingsley is 4-0 with a 2.76 ERA in eight games (seven starts) against the Marlins. Koehler has a 5.40 ERA in one start against Philadelphia.