"I've never really seen that many happy faces in the dugout at the same time," said Ortiz, who was one of a franchise-record seven different Red Sox batters to homer in the game. "It was like lighting a firework. ... I see everybody happy. It's like the fireworks just keep on coming."

Boston pulled away in an eight-run sixth inning when Will Middlebrooks hit a grand slam, Ortiz had an RBI double to reach 2,000 and Daniel Nava added a two-run homer. Ortiz homered again in the five-run seventh -- the 427th of his career to move past Billy Williams and into 47th on baseball's all-time home run list.

"Congratulations to David. That's a heck of a milestone," Tigers manager Jim Leyland said. "I'm sure the Red Sox fans are proud of him and he's proud of himself. He's had a wonderful career and he's popular here. A very kind man, really. I'm very happy for him. It came against the wrong team, but that's OK."

AL East-leading Boston has won nine of 11, taking two out of three from the Central-leading Tigers to hold onto the best record in the league. After scores of 3-0 and 2-1 in the first two games of the series, the Red Sox burst out with a franchise record-tying eight homers and a season-high 20 runs.

Jacoby Ellsbury, Stephen Drew, Mike Napoli and Ryan Lavarnway also homered as the Red Sox turned a game that was tied 4-4 after four innings into a blowout.

"Just a rare and outstanding offensive night tonight," said Red Sox manager John Farrell, who had Shane Victorino steal second in the fifth inning to try to get the go-ahead run in scoring position. "You think at that point you're looking to somewhat manufacture a run any way you can. Little did we know it would turn out like it did. ... We had no idea of what was about to take place shortly after that."

Ryan Dempster (8-9) allowed four runs on six hits and two walks in six innings, striking out seven to win his second straight start since he was suspended for five games for intentionally hitting New York Yankees slugger Alex Rodriguez.

The Red Sox open a four-game series with the Yankees in New York on Thursday night.

Rick Porcello (11-8) gave up nine runs -- eight of them earned -- on seven hits and four walks in five-plus innings. He allowed three homers -- Al Alburquerque gave up two, Jeremy Bonderman allowed two and Evan Reed gave up one.

"That was pretty ugly," Leyland said. "Obviously we just didn't a good job of keeping the ball in the ballpark. The Green Monster's one thing, but you normally don't see them going out to right field like that. They were hitting them out like ping pong balls."

Ortiz homered in the fourth to tie the game 4-all, then added an RBI double in the sixth for hit No. 2,000. He waved his batting helmet as he stood on second base while the crowd cheered and home plate umpire Jeff Kellogg helped the Red Sox dugout retrieve the ball.

Ortiz homered the next time up, prompting another standing ovation from the crowd at Fenway. The fans remained on their feet until he popped out of the dugout for a curtain call.

Prince Fielder homered for the Tigers, who were without Miguel Cabrera for the third time in four games with a strained abdominal muscle. A reigning triple crown winner, Cabrera leads the majors again with a .355 average with 130 RBIs and is four behind Baltimore's Chris Davis with 43 homers.

Detroit shortstop Jose Iglesias, who was acquired from Boston at the trading deadline, left in the fifth inning with pain in his shins.

Shane Victorino singled with one out in the fifth, stole second and took third when catcher Alex Avila threw the ball into center field. On the 11th pitch of his at-bat, Dustin Pedroia hit a sinking line drive that left fielder Andy Dirks caught just off the grass but he could not keep Victorino from tagging up and scoring to make it 5-4.

The Red Sox blew it open with eight in the sixth thanks to a bases-loaded walk, two homers and Ortiz's double. They added two more in the eighth to make it 20-4.

Game notes

The only other time the Red Sox have hit eight homers in a game was July 4, 1977, against Toronto at Fenway Park. ... Nava has reached base safely in 39 consecutive games, the longest active streak in the majors. ... The Chicago Cubs, run by former Red Sox general manager Theo Epstein, claimed former Red Sox reliever Daniel Bard off waivers. ... Farrell said Clay Buchholz's wife gave birth to a daughter. The right-hander will resume his rehab stint with Triple-A Pawtucket in Rochester on Thursday night before joining the Red Sox in New York. ... Porcello had allowed three or fewer runs in 10 of his last 11 starts. But in his career he is 1/3 with a 10.42 ERA against the Red Sox. ... Victorino went over the short wall along the first-base line to retire Austin Jackson and end the fourth inning. Victorino then returned what appeared to be a cellphone to a woman in the front row.