MIAMI (AP) — Giancarlo Stanton had two hits in his homecoming but closer Aroldis Chapman left the game accompanied by a trainer as the New York Yankees beat the Miami Marlins 2-1 in 12 innings Tuesday.

After Yankees backup catcher Kyle Higashioka raced home on a sacrifice fly in the 12th, Chapman came on trying for his 32nd save, but he departed with none out when his troublesome knee flared up.

Stanton, playing in Miami for the first time since he was traded after eight seasons with the Marlins, singled in the first and missed a homer by a few feet when he doubled off the left field wall in the fifth. He also struck out three times and grounded out to remain at 299 career homers.

The Marlins had runners at the corners with none out in the ninth, and loaded the bases with none out in the 11th, but both times failed to score. Chad Green and A.J. Cole (3-0) pitched out of the jams.

The Yankees (79-46) won their fourth game in a row to climb 33 games above .500 for the first time since 2011.

Chapman walked Isaac Galloway leading off the 12th, threw a wild 96 mph fastball to the next batter and signaled to the dugout. After consulting with the trainer he left the game, and Tommy Kahnle came on to earn his first save since 2016. Chapman is likely to get an MRI.

Higashioka threw out Galloway trying to steal second to end the game.

David Robertson, who might normally close in Chapman’s place, was unavailable because of a shoulder issue.

When Stanton stepped to the plate in the first inning and received a warm ovation from the crowd of 26,275, he saluted, waved and patted his chest while looking toward the stands. He then singled sharply to left field.

A brief scoreboard tribute to Stanton in the second inning prompted more cheers while he stood in right field, and he waved his cap.

Higashioka entered the game in an 11th-inning double switch and led off the 12th with a single against Javy Guerra (1-1). After the Yanks loaded the bases, Miguel Andujar hit a sacrifice fly to left field, with Higashioka sliding home ahead of the throw.

The Yankees played without shortstop Didi Gregorius, who went on the 10-day disabled list with a bruised left heel. That left the Yankees without three injured regulars, and the depleted lineup managed only three hits in the final eight innings.

Gleyber Torres did contribute two hits starting at short for Gregorius. Greg Bird went 0 for 6 with three strikeouts and drew boos from the many Yankees fans in the crowd.

Neil Walker’s RBI single in the fourth put New York ahead. Austin Dean homered for the Marlins in the fifth.

New York’s Masahiro Tanaka and Miami’s Pablo Lopez each allowed one run in six innings.

Seven Yankees relievers combined for six scoreless innings. Miami went 0 for 10 with runners in scoring position.

HEAT

Marlins right-hander Tayron Guerrero threw 14 pitches at 100 mph or more in the seventh, when he struck out the side.

CLOSE CALL

Standing on deck, Miami’s Derek Dietrich had to duck out of the way when teammate Brian Anderson sent the bat sailing toward his head after a swing and miss.

TRAINER’S ROOM

Yankees: C Gary Sanchez (groin) is expected to begin a rehab assignment Thursday in the Gulf Coast League, and then go to Triple-A Scranton/Wilkes-Barre for about a week of games.

UP NEXT

Yankees RHP Lance Lynn (8-8, 4.68) is scheduled to start the series finale Wednesday night against RHP Trevor Richards (3-7, 4.28).

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