BOSTON, Mass. (CBSNewYork/AP) — The New York Yankees clinched home-field advantage for the AL wild-card game on Friday night, hitting four homers to tie the major league single-season record and beat the Boston Red Sox 11-6.

Reigning Rookie of the Year Aaron Judge hit his first homer since coming off the disabled list Sept. 14, and Gary Sanchez, Aaron Hicks and Luke Voit also homered to match the mark of 264 set by the 1997 Seattle Mariners.

The win in the opener of the three-game series settled the AL’s last remaining postseason question with two games to go. The Yankees will host the Oakland Athletics on Wednesday for the right to play Boston in the divisional round.

The Red Sox, who clinched the best record in baseball with a franchise-record 107 wins, were hoping to make things difficult for their arch-rivals — and the Athletics, too — by forcing the winner of the wild-card game have to fly cross-country next week. The ALDS begins in Boston on Friday.

J.A. Happ (17-6) pitched three perfect innings and allowed just one hit through five. Staked to an 8-0 lead, he loaded the bases in the sixth for Steve Pearce’s grand slam but got Rafael Devers on a groundout to end the inning.

In all, Happ allowed four runs on four hits and two walks, striking out seven in six innings. He would be on regular rest for the wild-card game, but manager Aaron Boone has not announced his postseason pitching plans.

Sanchez homered to lead off the third, just his second homer and fourth hit of any kind in two weeks. Hicks hit a three-run shot in New York’s six-run fourth. Voit hit a solo shot in the seventh and Judge hit his 27th of the year in the eighth to make it 11-4.

Boston scored once and loaded the bases in the bottom of the eighth against Dellin Betances, but Eduardo Nunez lined out to second to end it. The Red Sox loaded the bases in the ninth before Zach Britton walked Xander Bogaerts to score a run and cut the deficit to 11-6.

But Pearce grounded out on a 3-2 pitch to third base to end it, giving the Yankees their 99th win.

DOUBLING UP

Miguel Andujar’s fourth-inning double was his 44th of the season, tying Joe DiMaggio for the record by a Yankees rookie.

TRAINER’S ROOM

Yankees SS Didi Grigorius returned to the lineup for the first time since Saturday because of torn cartilage in his right wrist. Hicks also returned to the lineup; he missed two games with tightness in his left hamstring.

UP NEXT

Yankees RHP Lance Lynn (9-10) is scheduled to face RHP Nathan Eovaldi.

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)