When Jalen Beeks last pitched for the Portland Sea Dogs, it was April 13 against the Trenton Thunder and Beeks gave up five runs in the fourth inning, exiting with two outs.

Thinking redemption, Beeks started the first game of a doubleheader Saturday afternoon at Hadlock Field. Trenton immediately loaded the bases with no outs in the first inning.

“I don’t think that’s ever happened,” Beeks said. “(I had) to just keep throwing. I didn’t feel like my stuff was terrible.”

It wasn’t.

Beeks struck out the next three batters to escape. He went on to pitch a five-hit shutout in a 3-0 Sea Dogs win.

Trenton scored five unearned runs in the second game, earning a split with a 5-0 victory.

The Sea Dogs (8-5) remained a few percentage points ahead of the Thunder (9-6), in the Eastern League’s East Division standings. The teams play again at 1 p.m. Sunday.

Nick Longhi homered in the first game for Portland. Aneury Tavarez reached based five times in the two games, going 3 for 4 with two walks.

The games were played in raw, 42-degree conditions. It might have been more miserable for the Sea Dogs had Beeks (2-1) not figured things out.

Trenton sandwiched two walks around a single to load the bases.

“My mechanics were not good,” said Beeks, a left-hander. “I got out of it, luckily. I went heavy curveball with the bases loaded, hoping that if they were going to hit it, it was going to be soft.”

The curveball got two of the strikeouts in the inning, and he recorded the other on a 92 mph fastball. Beeks breathed out a sigh.

“Then I went back and sat down between innings, thought about it, fixed it in my mind. It worked out,” Beeks said.

What did he fix? Beeks, like any athlete, broke down his form.

“The first inning, I was collapsing on my front side so I was really driving it, down into the ground instead of through to the glove. I thought about keeping my chest tall and that kind of fixed it.”

Over the next six innings – minor-league doubleheader games are seven innings – Beeks gave up four harmless hits and no walks. He struck out seven with his mix of fastball, cutter, curve and change-up.

“A pitcher has to be able to make adjustments and he did,” Sea Dogs Manager Carlos Febles said. “He pitched with conviction after (the first inning).”

Tavarez led off the bottom of the first with a double and scored after Mike Olt’s single when left fielder Billy McKinney bobbled the ball.

Tavarez is batting .381. Going back to June 1 of last year, Tavarez is hitting .375.

“He’s picked it up where he left off,” Febles said. “He finds a way to get hits.”

In the fourth inning, Longhi hit his second home run of the season, belting a 94 mph fastball from Domingo German (0-2) over the left-field wall.

Portland made it 3-0 in the sixth. Rafael Devers doubled and scored on Tzu-Wei Lin’s single. It was Devers’ only hit in six at-bats Saturday. He’s batting .348.

In the second game, second baseman Jose Rosario made two of his three errors in the fourth inning, leading to four runs. Reliever Jake Cosart (1-1) got the loss. He allowed a bunt single and two walks in the inning.

An Olt error at third base allowed another unearned run in the fifth.

Trenton starter Nestor Cortes held Portland to one hit over six innings.

Sea Dogs reliever Ty Buttrey pitched two hitless innings with three strikeouts. He has 15 strikeouts in 82/3 innings.

NOTES: The announced paid attendance was 4,941. … The doubleheader began a half-hour late because of the wet conditions and the threat of another downpour (which fizzled out). … Shortstop Gleyber Torres, the Yankees’ No. 1 prospect, is on the disabled list because of a sore right shoulder. Torres hit .448 for the Yankees in spring training.