BALTIMORE — The night began with promise for Aaron Cook and the Red Sox.

The righthander was perfect through three innings of Wednesday night’s game against the Baltimore Orioles at Camden Yards, having thrown just four balls in 25 pitches. Although he issued a leadoff walk to Nick Markakis in the fourth, Cook did not allow a hit through five. Then, he and the Sox imploded in the sixth inning of a 5-3 loss.

“He really pitched well for the five innings, and [was] fielding his position really well during that time,’’ said Sox manager Bobby Valentine, who was ejected in the eighth inning by home plate umpire Mike Everitt for arguing the ejection of Adrian Gonzalez. “He just had a misplay that could’ve got us out of the inning and — ah, Lordy — we didn’t turn the double play, gave up a double, and the next thing we were down by a few runs.’’

Advertisement - Continue Reading Below

In Baltimore’s five-run, six-hit outburst in the sixth, Cook lost the no-hitter, then the shutout, then the game when he departed after allowing five runs (two earned) on three hits and three walks (tying a season high) in 5 innings.

“I let the team down,’’ said Cook, after the Sox (57-61) lost for the eighth time in 11 games against the Orioles this season to remain 6½ games behind the Tampa Bay Rays for the second wild-card berth. “We’re trying to win games, and that’s one we should’ve won. And we lost because I made an error.’’

Cook was haunted by a throw he made on Adam Jones’s sharp comebacker. Cook attempted to start a double play by spinning around and throwing to second, but his throw went bounding into center field and put the go-ahead run on third.

“It’s a play I’ve made over a hundred times,” Cook said. “I just didn’t get my feet set and tried to make a quick throw. I had plenty of time and just yanked it. It was just a bad throw and it ended up costing us a game. Stuff like that can’t happen.

“I’ve got to be able to set my feet, take my time, make a good throw, and we’re out of that inning with one run [allowed] and we’re in here high-fiving right now.’’

Matt Wieters sent Cook from the game when he belted a ground-rule double that eluded left fielder Carl Crawford and allowed Nate McLouth to score, giving the Orioles a 3-2 lead.

Mark Reynolds, who homered twice in Tuesday night’s 7-1 victory over the Red Sox, once again delivered the crowning blow for the Orioles, hitting a two-run double to left off Junichi Tazawa that Crawford seemed to misplay, or worse, didn’t attempt to play as he never stretched out his glove.

“You guys can write whatever you want on that, but it was just a tough play, in my mind,’’ Crawford said. “It just sailed over my head. I don’t think I could’ve made that catch, to be honest with you guys. It was way over my head. I pretty much didn’t get it.’’

Asked for his take, Valentine replied, “Tough play.’’

After pushing across a pair of runs in the fifth on Jacoby Ellsbury’s ground-rule double to center off Miguel Gonzalez (5-2) and Crawford’s sacrifice fly to center, the Sox clawed their way to an unearned run in the seventh off J.C. Romero, who spelled Gonzalez after he gave up two runs on six hits over six innings.

Nick Punto smashed a comebacker and reached when Romero misfired on the throw to first. Ellsbury followed with a single to center that advanced Punto to third. Crawford then grounded to second, allowing Punto to score, making it 5-3.

Luis Ayala came in to face Dustin Pedroia and got out of the inning when he induced the second baseman to ground to third.

After Craig Breslow, who entered in relief of Tazawa and got the last out of the sixth, submitted a 1-2-3 seventh, the Sox allowed their frustrations to boil over in the eighth after Gonzalez swung at a quick-pitch from reliever Pedro Strop.

Gonzalez wound up grounding to second, then was ejected by Everitt after saying the quick-pitch should have been ruled a ball. When Gonzalez’s plea fell upon deaf ears, the first baseman said, “Mikey, you stink,’’ which earned him his second career ejection.

“I wasn’t ready to hit,’’ Gonzalez said. “I wasn’t out of the batter’s box. When I come set up with the bat on my shoulder and the pitcher comes set, I kind of get into my position to hit and I was still in a position where I wasn’t ready to hit. My argument was that they called that same play a ball on Franklin [Morales] earlier in the year. He does the same thing and the umpire said it was a ball. It needs to be universal. It can’t be interpreted by each individual. That’s my argument.’’

Valentine came out of the dugout to take up Gonzalez’s argument, and wound up getting tossed as well. It was his fourth ejection of the season and 41st of his managerial career.

“Adrian thought maybe Mike should’ve called something and he didn’t call it,’’ Valentine said. “Adrian told him what he thought and I reiterated it.’’

It was symbolic of the mounting frustrations of a team struggling to keep its head above water only to find itself sinking fast in the AL East standings and the wild-card race.

Asked if he was more angry at the way the sixth inning went for his team or at the eighth-inning double ejection, Valentine said, “I just don’t like losing. They just scored more runs than we did.’’