BOSTON — It was party night for the Boston Red Sox at Fenway Park.

After splitting a pair of pitcher’s duels, the Red Sox broke out the heavy artillery and won the series against the Detroit Tigers with a 20-4 blowout Wednesday night.

The Red Sox tied a franchise record with eight home runs, including two by David Ortiz, who also got his 2,000th hit. Will Middlebrooks also stroked a grand slam in a potential playoff preview between the teams atop the American League standings.

“It’s hard to explain,” Red Sox manager John Farrell said after his team broke open a 4-4 tie with 16 unanswered runs.

On the other side, Tigers manager Jim Leyland said, “This was pretty ugly, but that’s the way it goes.

“We obviously didn’t do a good job of keeping the ball in the ballpark. The Green Monster’s one thing but right field you don’t normally see them go out like that. They were going out like ping-pong balls.”

The Red Sox, winners of five of their last six and nine of their last 11, closed a 7-2 homestand with the best record in the American League. They notched their 84th win, 15 more than last season — and this is already the franchise’s biggest season-to-season increase in wins (in nonstrike years) since the 1967 Impossible Dream team won 20 more games than the 1966 version.

Boston led 5-4 entering the bottom of the sixth on the strength of a two-run homer by Stephen Drew and solo shots by Ortiz and Jacoby Ellsbury off loser Rick Porcello (11-8).

The Red Sox offense exploded for eight runs in the sixth inning with the big blows being Middlebrooks’ grand slam and Nava’s two-run shot off Al Alburquerque.

But Boston was far from done.

Ryan Lavarnway hit his first homer of the season in the seventh, a two-run blast, and Ortiz added another two-run home run — his 26th homer of the year.

Mike Napoli connected in the eighth.

Ortiz, who moved past Billy Williams and into 27th place on the all-time home run list, with 427, also stroked an RBI double in the sixth inning, the 2,000th hit of his career. His two homers were shots over the Red Sox bullpen.

He received a long ovation after the double.

“Well deserved. Well deserved,” said former teammate and current Tigers DH Victor Martinez. “What he has done for that organization. I think it’s well deserved. I’m really happy to see. a really good man on and off the field. I’m really happy to see what he’s doing.”

Added Leyland: “I’m a fan of the game. Congratulations to David. That’s a heck of a milestone. I’m sure the Red Sox fans are proud of him and I’m sure he’s proud of himself. He’s had a wonderful, wonderful career,” Leyland said.

“He’s a very popular player,” Leyland continued. “A very kind man, really. I’m very happy for him. Under the circumstances it came against the wrong team but that’s OK.”

Ortiz, one of three active players with 2,000 hits, 400 homers and 1,400 RBIs, said after the game, “What can I tell you? I just always try to come in and try to do something to win a ballgame. I always get caught off guard when it comes down to personal numbers. Most of you guys sometimes come to me telling me how far I am from doing things.

“Those (sorts) of things surprise me because I’m not keeping track of things. I just come to the field with my mind focused on winning the next game,” Ortiz said. “And that’s me. But it’s great getting to that milestone and to accomplish numbers that are (reached) at some point when you’re into playing baseball — you look at them and thank God for giving you a nice career.”

The Red Sox had 13 extra base hits, scored in all seven innings after the first and had 15 runs in the last three. The eight homers were also a Sox Fenway Park record. Homers by seven players set a franchise record.

Ryan Dempster, who might have been making his last start with Clay Buchholz due back next week, gave up four runs in the first four innings but worked six innings and improved his record to 8-9.

Dempster gave up a two-run homer to Prince Fielder. Miguel Cabrera, who played Tuesday, was out again with his core injury.

NOTES: The 20 runs were the most scored by Boston since a 25-8 win over the then Florida Marlins on June 27, 2003. … Tigers SS Jose Iglesias left the game in the fifth inning with bilateral shin splints. … Cabrera, named American League player of the month, has missed four of the last five games. … RHP Max Scherzer, who failed to join Roger Clemens as the only pitchers ever to start a season 20-1 with his tough loss Tuesday, was named AL pitcher of the month. He was also defended by his manager, Jim Leyland, who spoke out against a TV graphic that said Scherzer would have taken an 11-10 record to the mound Tuesday if he would have gotten run support similar to what Boston’s John Lackey has received. … The Tigers open a three-game series in Kansas City Friday night, with Anibal Sanchez pitching. … Red Sox C Jarrod Saltalamacchia missed his second straight game and will likely miss at least one more with a sore back. … Buchholz’s wife delivered the couple’s second daughter Wednesday and Buchholz will be in Rochester, N.Y., Thursday night to make his third and final rehab start.