MIAMI (AP) — Jorge Alfaro homered twice before he took a foul ball to his helmet and the Miami Marlins beat the Boston Red Sox 8-4 on Wednesday night.

Garrett Cooper also homered and scored twice for Miami, which moved within 2 1/2 games of first-place Atlanta in the NL East.

READ MORE: 96-Year-Old Charite Ernest Missing Since Saturday

Alfaro, the Marlins’ catcher, was removed in the seventh inning as a precaution after Christian Vázquez’s foul ball beaned him.

“Just getting past the baseball and just trying to make sure that he’s good and not let him catch another foul ball,” Miami manager Don Mattingly said of the decision to remove Alfaro.

Miami chased Boston starter Michael Kickham with a four-run third. Alfaro hit his first of two two-run blasts. Brian Anderson had a run-scoring single and scored from first on Lewis Brinson’s RBI double to make it 6-1.

“We just pass the baton, we trust each other with anything,” Brinson said. “There’s no selfish player on this team. There’s nobody that’s here for their numbers.”

Alfaro also went deep in the fifth, a 412-foot shot to left-center off Robinson Leyer.

Yimi Garcia (2-0) pitched a perfect eighth and was credited with the win even though he entered with an 8-4 lead. Brandon Kintzler was the sixth Miami reliever and worked a scoreless ninth.

READ MORE: 14-Year-Old Girl Injured In Miramar Triple Shooting

Miami starter Trevor Rogers allowed one run on three hits, walked two, hit a batter and struck out three. He was lifted after 76 pitches after he took a hard-hit ball from Yairo Munoz off his back, retrieved it and threw Munoz out at first for the final out of the third.

“It tightened up on me right away,” Rogers said. “I went to the trainer and he took care of it. It feels a lot better. Location was a big issue tonight so I was trying to lock it in and compete.”

J.D. Martinez snapped a 1-for-30 funk with a two-run homer off Miami reliever Ryne Stanek in the seventh. Martinez drove in another run with a sacrifice fly in the third and singled in the ninth.

“To see him have the power to get the ball out — opposite field here, you’ve got to kill it,” Boston manager Ron Roenicke said. “And then he followed it with a base hit. Good swings all night from him.”

Cooper hit a two-run homer to center in the first that snapped a 14-inning scoreless string by Red Sox pitchers.

Kickham (1-1) allowed six runs on seven hits in 2 2/3 innings.

Alex Verdugo had three hits, a walk, and scored twice for Boston.

MORE NEWS: Aventura Mall Packed On Mother’s Day Just One Day After Shooting

(© Copyright 2020 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)