This one was shaping up to be a flat-out gut punch.

The Orioles appeared to be on the way to an uplifting victory when it all seemed to evaporate in a disastrous sixth inning that featured an epic collapse by slumping starting pitcher Ubaldo Jimenez.

Turns out, all was not lost because the muscular offense that awakened Wednesday night regained its swagger Thursday night with a season-high seven-homer performance that carried the Orioles to a 12-7 victory and a split of the four-game series at Camden Yards.

Right-fielder Mark Trumbo hit a pair of moon shots to move into a tie for the major league home run lead with 17, and Adam Jones hit a pair of homers, including his 200th as an Oriole, but it was a dramatic three-run blast by Manny Machado in the seventh inning that put the Orioles back in control of a game that had heartbreak written all over it.

Designated hitter Pedro Alvarez and new catcher Francisco Pena also homered in the eighth inning, but that was just gravy. The Orioles, who had been outhomered by the Red Sox 12-0 coming into the series finale, rediscovered their power stroke against Red Sox starter Rick Porcello and the Boston bullpen.

“Runs are runs,” manager Buck Showalter said. “You're going to need all you can get against them. They're locked in offensively. As much as they might have not been when we played them the first time, they are on the other side. If they continue at this pace, you know. … It was nice to score that many runs regardless. Our guys just decided they were going to have to outscore them.”

The victory represented a change of fortune for the Orioles, who had lost seven of their previous nine games after Kevin Gausman unraveled in the early innings of Tuesday night's game. The Orioles also had lost Monday with their No. 1 starter (Chris Tillman) on the mound, so what really were the prospects for the two games left, to be started by struggling Mike Wright and Jimenez?

Both did struggle badly, but the offense finally erupted, and the Orioles have won four of their past seven games and climbed back to within one game of the Red Sox in the American League East standings.

“A lot of people would have folded the tent after the first two games,” Showalter said, “but our guys got their dander up a little bit.”

The twin Trumbooms: Trumbo is one of the strongest guys in the game, and it showed in his second and third at-bats. He hit a 1-2 pitch into the left-field bleachers in the fourth inning that measured 441 feet and had an exit velocity of 115 mph. Both those numbers were season highs for him, according to MLB's Statcast. In other words, he hit it really, really hard. But, apparently, not hard enough, because he came up in the sixth and launched his second homer of the game and 17th of the year — this one measuring 458 feet to straightaway center and tying with Chicago White Sox third baseman Todd Frazier for the major league lead.

Unsung hero: Lost in the meteor shower was a clutch performance by reliever Mychal Givens, who bailed out Jimenez and pitched a strong 12/3 innings, striking out three.

peter.schmuck@baltsun.com

twitter.com/SchmuckStop