BOSTON -- When the season began, the New York Yankees wondered among themselves if they might be able to display some record-breaking power.

They now have their answer.

With a two-run shot from Gleyber Torres in the fourth inning at Fenway Park on Saturday, the Yankees set a record for home runs hit in a single season by a team. The blast, off Boston Red Sox lefty Eduardo Rodriguez, was their 265th, surpassing the previous record of 264 hit by the 1997 Seattle Mariners.

"Everybody knew that was the number," said Torres, who kept pumping his fist as he rounded first during his home run trot.

The Yankees didn't stop there. Giancarlo Stanton, who leads the team with 38 home runs, hit No. 266 in the seventh inning as New York won 8-5.

When he was traded to the Yankees last December, Stanton made a rather memorable remark about the potency of his new team's offense.

"I feel sorry for the baseballs," Stanton said at the time.

Asked Saturday for an update on his empathy toward the baseballs following this season's record-setting blasts, Stanton smiled and said: "We've got 266 that are screaming still."

Stanton's comments echoed those made earlier in the weekend by right fielder Aaron Judge. The record was something that, at least peripherally, had the Yankees' attention.

"We talked about it once we started getting closer," Judge said Friday night, just after the Yankees tied the Mariners' 21-year mark. "Especially early in the year, we kind of looked at our lineup and the type of firepower we had."

The Yankees hit four home runs in Friday night's win over the Red Sox. The day before at Tampa Bay, they also hit four.

On a 1-1 count, Torres took a 93.7 mph two-seam fastball and deposited it into the Red Sox bullpen, just beyond the low right-field fence. The ball was quickly retrieved within the bullpen and given to the Yankees, who also recovered their 264th home run ball on Friday night.

Although wowed by the Yankees' accomplishment, manager Aaron Boone isn't fully surprised it happened.

"I guess it was possible, because those were the first questions I got on the job," the first-year manager said. "I guess when you look back, though, it's the way in which we've done it. The amount of people that maybe you didn't expect to contribute as many home runs as they have, that's been special.

"So many guys have had a significant hand in breaking that record."

Torres also hit the team's 20th home run from the No. 9 spot in the batting order, making them the first team in MLB history with 20 or more home runs from every spot in the lineup.

The Bronx Bombers have been paced in long balls this season by Stanton's 38. Miguel Andujar, Didi Gregorius, Aaron Hicks and Judge are tied for second with 27.

A dozen players have 10 or more homers, including Luke Voit, the trade-deadline acquisition from St. Louis who has 13 home runs since his arrival. Voit entered Saturday tied with Milwaukee's Christian Yelich for the most homers hit in baseball within that span.

The Yankees have solidified home-field advantage in Wednesday's American League wild-card game against the Athletics.