TRENTON, N.J. — It wasn’t a fitting ending.

In a game that featured a combined 27 hits, it was a bases-loaded walk in the 11th inning that gave the Trenton Thunder an 8-7 victory over the Portland Sea Dogs on Thursday night at Waterfront Park. It was the third loss in four games against the Thunder for Portland (9-15), which dropped six games under .500 for the first time and limped home with a 1-6 record on this seven-game trip.

Dan Brewer’s walk off Kyle Fernandes in the 11th gave Trenton the improbable victory, considering the Thunder trailed all game and sent the game into extras with a two-run ninth. Fernandes, pitching his second inning, gave up a bunt single to Austin Krum to open the final inning. After Corban Joseph struck out, Krum stole second. Fernades intentionally walked Austin Romine and then walked Bradley Suttle on four pitches to load the bases with one out.

The count was 2-2 on Brewer, but Fernandes’ next two fastballs were called balls, though both could have been called strikes.

“No it has nothing to do with that at all,” said Portland Manager Kevin Boles, responding to a question about whether the strike zone got tight. “We didn’t make quality pitches when needed.

“We just weren’t able to hold the game in check.”

It looked as though Portland was going to leave Trenton with a split after Ryan Lavarnway’s long two-run homer over the high wall in left in the eighth gave the Sea Dogs a 7-5 lead.

“Offense did a real nice job, especially against their starter who is very tough,” Boles said. “The home run by Lavarnway gave us a little bit of a cushion there.”

The Thunder tied it in the ninth, though, with a pair of runs off Eammon Portice.

Krum led off with a double and scored on Joseph’s single to bring Trenton within 7-6. Portice struck out Romine for the first out, but Suttle singled to right to put runners on first and third with one out.

And pinch-hitter Cody Johnson, a former first-round pick of the Atlanta Braves, plated Joseph with a sacrifice fly to center to tie it at 7.

In two innings, Portice allowed four runs on seven hits, ruining Portland starter Stephen Fife’s best outing of the season.

The right-hander pitched six strong innings, allowing one run on four hits while striking out four and walking one.

Portland got the go-ahead run in scoring position in the 11th, but Tim Federowicz grounded out to end the inning.

The Sea Dogs jumped out to a 2-0 lead in the second on RBI singles by Che-Hsuan Lin and Alex Hassan, working Trenton starter Manny Banuelos for 54 pitches through two innings and loading the bases in both.

Melky Mesa got the Thunder on the board in the second, driving Fife’s 1-2 offering over the fence in left-center to pull Trenton within 2-1.

Oscar Tejeda’s sacrifice fly to left scored Will Middlebrooks (double) in the third put Portland back up two runs, 3-1.

Portland took advantage of some shaky Trenton fielding in the seventh to score another and take a 4-1 lead.