NEW YORK — The Boston Red Sox clinched the American League East title too late to celebrate with an all-nighter in Manhattan. But it ensured a heck of an entertaining plane ride to Cleveland.

After losing two straight games in the Bronx, the Red Sox put the finishing touches on their first big objective of the season Thursday night. Mookie Betts strengthened his MVP credentials with a four-hit, five-RBI night, and Boston wrapped up its third straight division title with an 11-6 victory over the New York Yankees.

Once closer Craig Kimbrel struck out Giancarlo Stanton for the final out, the Red Sox celebrated in the infield to the sounds of Frank Sinatra’s “New York! New York!” over the stadium loudspeakers. A sizable contingent of Boston fans chanted “Let’s go Red Sox!” and greeted Betts with shouts of “MVP” as he came off the field. It marked the first time the Red Sox ever had clinched the division with a win over the Yankees, according to Elias Sports Bureau.

Soon afterward, the Red Sox sprayed champagne and tried out a few dance moves in a visiting clubhouse covered in plastic. They held a raucous but relatively brief celebration before getting ready to leave town on a charter flight to Cleveland.

“Winning a division isn’t easy,” J.D. Martinez said. “It’s tough to do. This all started in spring training with the mindset we had right off the bat. The goal here is to win. We’re obviously not done. But it’s the first step, and we’re proud of it.”

The Red Sox (104-49) now can turn their attention to setting up their postseason rotation and resting regulars while trying to maintain their competitive edge heading into October. Barring an abrupt turn of events, they will face either the Yankees or the Oakland Athletics, who are separated by 1½ games in the wild-card race, in the AL Division Series opener at Fenway Park on Oct. 5.

“It’s your rival, so you don’t want your rival to come in here and get to pop bottles at your field,” Yankees first baseman Luke Voit said. “But they did, and credit to them. They’re a good team. Hopefully we get to face them later on down the road.”

What was billed as a potential titanic AL East race has been resolved a lot sooner than most expected in spring training. The Red Sox extended their division lead over New York to 10½ games with Thursday’s win and joined the Cleveland Indians as the second MLB team to clinch a division title.

The Red Sox need to go 2-7 over their final nine games against Cleveland, the Baltimore Orioles and the Yankees to set a franchise record with 106 victories. The 1912 Boston team, which was led by Hall of Fame outfielders Tris Speaker and Harry Hooper and 34-game winner Smoky Joe Wood, went 105-47.

Betts was a force at the plate all night. He lined a double off the left-field wall against Masahiro Tanaka to lead off the first inning and added a single, a double and a three-run homer off Aroldis Chapman in the eighth to make the score 11-6 and prompt fans to begin leaving the stadium. Betts became the first Red Sox player ever with four hits and five RBIs in a game at Yankee Stadium.

With his momentous performance, Betts improved his season slash line to .339/.432/.635. It marked the major-league-leading 19th time he has reached base four or more times in a game this season. With 30 homers and 28 stolen bases, Betts needs two more steals to join Jacoby Ellsbury as the second 30-30 player in franchise history.

Before the clincher, Betts was in a 2-for-18 funk and hadn’t homered in September. He was sufficiently out-of-sync that manager Alex Cora took him aside for a brief pep talk Wednesday night. Among other things, Cora told Betts that he just needed to go the other way and wait for his pitch.

“He just sat me down and told me to relax,” Betts said. “He said, ‘Even if you don’t do anything for the rest of the season, it doesn’t matter. You’ve had a great season.’ He repeatedly tells me, ‘There’s no doubt in my mind you’re the best player in the league.’ Hearing that from the top guy in the clubhouse, that’s obviously a confidence booster.”

The Red Sox received a strong performance from knuckleballer Steven Wright (3-1), who has been used exclusively out of the bullpen since his return from a knee injury two weeks ago. Wright entered the game after Stanton’s grand slam gave the Yankees a 6-4 lead in the fourth inning, and he proceeded to throw three shutout innings to extend his streak of scoreless frames to 10.

The Red Sox received an additional piece of good news when reliever Matt Barnes, who has 92 strikeouts in 58⅓ innings this season, was cleared to return after missing almost three weeks with a hip injury. Barnes warmed up in the bullpen Thursday, but never entered the game.

Jackie Bradley Jr.’s solo homer off Chad Green tied it at 6 in the seventh, and Boston tacked on five more against Green, Dellin Betances and Chapman to win in a rout.

The clinching party capped an eventful and emotional day for Cora, who made reference in his pregame media session to the one-year anniversary of Hurricane Maria wreaking devastation on his native Puerto Rico.

As Cora reflected on Boston’s 104th victory from the quiet of his office, his cellphone continuously buzzed with text messages from friends, family and other well-wishers back home.

“My phone is going nuts,” Cora said. “I had a lot of friends in the stands today, and I know this means a lot to them. Every time we win, someone is happy back home. I’m proud of that.”