MIAMI — The Yankees won Giancarlo Stanton's homecoming game but may have lost their closer.

Aroldis Chapman left the game with pain in his troublesome left knee, and New York scrambled to close out a 2-1 win over the Marlins in 12 innings Tuesday night.

Stanton, playing in Miami for the first time since he was traded after eight seasons with the Marlins, received a warm reception from the crowd and missed his 300th career homer by a few feet.

After Yankees backup catcher Kyle Higashioka raced home on a sacrifice fly in the 12th, Chapman came on to try for his 32nd save. He walked Isaac Galloway leading off, threw a wild 96 mph fastball to the next batter and signalled to the dugout.

After consulting with a trainer, Chapman departed. He said he felt pain in the same spot as in the past, but worse than before. He averaged 96 mph on his fastball, his lowest for any outing since 2013, according to ESPN Stats & Info.

"Previously I've been able to pitch with it, to manage it," the Cuban said through a translator. "The discomfort is constant."

Tommy Kahnle came on to earn his first save since 2016. Higashioka threw out Galloway trying to steal second to end the game.

Chapman will likely undergo an MRI to diagnosis his ailment, manager Aaron Boone said.

"Virtually every other time he has been able to work through it," Boone said. "For him to call attention to it, that has me concerned."

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.

When Stanton stepped to the plate in the first inning and received a loud ovation from the crowd of 26,275, he saluted, waved and patted his chest while looking toward the stands.

"That was really cool — definitely more than I could ask for," Stanton said. "That's going to be one of the more special moments of my career."

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.

Stanton barely missed a homer 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.

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 flyout to left field, and Higashioka slid 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.

"It's not easy for us right now," Boone said. "We're going through a tough stretch. But that's also an opportunity for guys to step up."

Gleyber Torres contributed 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.

"The execution in those situations — I think some of that is lack of experience," Marlins manager Don Mattingly said.

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 missed.

TRAINER'S ROOM

Yankees: RHP David Robertson sat out because of tenderness in his throwing shoulder. He said he expects to be available Wednesday. ... 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).

___

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

___

Follow Steven Wine on Twitter: http://twitter.com/Steve_Wine.