RICHMOND, Va. — At least the Portland Sea Dogs were able to score some runs. And against a Major League pitcher, no less.

The Sea Dogs ended a 28-inning scoreless string Tuesday night with two runs against San Francisco right-hander Matt Cain in the third inning, but lost to the Richmond Flying Squirrels 4-3, extending their losing streak to five games.

The loss was also Portland’s eighth in its past nine games, during which the Sea Dogs have scored only 18 runs.

Cain, who is with the Squirrels on a rehab assignment, went 32/3 innings (55 pitches), allowing two runs on three hits. He walked one and also struck out two.

“That third inning, we had some momentum, scored two runs, and then gave three up,” said Portland Manager Billy McMillon. “That took the wind out of us a little bit. But it was really nice to see the guys get seven hits and score (three) runs. We just came up short at the end. We just have to keep grinding and try again tomorrow night.”

The Sea Dogs finally ended their scoring drought in the third off Cain. With two outs and Marco Hernandez on first via a single, Carlos Asuaje sent a long drive to left-center. Left fielder Daniel Carbonell got a glove on the ball but couldn’t hold it.

It was ruled a two-base hit and Hernandez scored easily. Jantzen Witte brought home Asuaje with a line single to center.

“That was one of those things where I was probably more fired up to face him than he was to face me,” said Witte, who had two hits and two RBI. “I tried to take advantage of a guy with that much experience. Luckily I was able to hit the ball hard one time off him.”

The Squirrels came back with three in the bottom of the third. After Engel Beltre doubled to open the inning, Justin Haley walked consecutive batters to load the bases, then gave up a two-run single to Ricky Oropesa to tie it.

A fielder’s-choice grounder brought in the go-ahead run.

Richmond increased its lead to 4-2 in the fourth on an RBI single by Beltre. That was it for Haley, who gave up seven hits, walked four and struck out four in four innings.

“He just wasn’t himself the first couple of innings,” said McMillon. “I think he walked four batters in the first two or three innings. He was able to pitch out of it the first two innings and we had some momentum going, then the double and two walks (in the third).”

The Sea Dogs (23-35) drew within 4-3 in the eighth on an RBI single by Witte, but Oscar Tejeda struck out with the tying run at second to end the inning.

“I think that’s been part of our story so far this year,” said Witte. “Not enough, too late. Hitting is contagious, though, so if we can string a couple good (at-bats) together, that will follow through the lineup. We’ve been scuffling at times to have those solid (at-bats) the entire game.

“We’ve still got a lot of games left. We’re not even halfway. But it’s time to bear down and win some ballgames.”

NOTES: Right-hander Jon Cornely was assigned to Portland from Triple-A Pawtucket and Pat Light was promoted. Also, outfielder Jonathan Roof was sent down to Portland. … Infielder Reed Gragnani was activated from the disabled list.