Justin Haley threw the first complete-game shutout for the Portland Sea Dogs in nearly two years Friday night, pitching a one-hitter in a 1-0 victory against the Binghamton Mets on a foggy, drizzly night at Hadlock Field.

Nate Freiman, playing in his third game for Portland after being signed from the independent leagues, hit a walk-off single in the seventh inning to lift the Sea Dogs to their third consecutive win over the Mets.

The game was scheduled as part of a doubleheader, but rain washed out the nightcap. The teams now will play two games starting at 1 p.m. Saturday.

Haley, who threw 63 of his 99 pitches for strikes, struck out five and walked three to lower his earned-run average to 1.93.

“He was efficient,” Manager Carlos Febles said. “He has a good fastball, a good mix that worked for him. He did a good job of throwing strikes and keeping the defense on their toes.”

It was the first complete-game shutout by a Portland pitcher since left-hander Henry Owens, now with Triple-A Pawtucket, defeated Altoona 3-0 in a seven-inning game on June 20, 2014, at Hadlock.

“We had success with a little bit of everything in different parts of the game,” Haley said. “The only thing that was really consistent was our conviction and our confidence.”

Haley said he was in sync with catcher Jake Romanski.

“There were times I felt he was reading my mind,” Haley said. “I was on the mound (thinking) I want to throw this pitch and that was the exact pitch he put down. We kept rolling with it … We were putting it into the zone and getting outs.”

It took seven innings of playing small ball for the Sea Dogs to score.

Portland, which had two runners thrown out at the plate, stranded at least two men in four innings.

To put men in scoring position, they laid down five successful sacrifices.

“We haven’t been swinging the bats well with men in scoring position, and we’re just trying to find a way to get the (pitchers) closer to the plate,” said Haley. “I like the fact we put all the bunts down.”

The winning rally began when Henry Ramos led off the bottom of the seventh with his second hit of the game. The next batter, Jose Vinicio, who laid down a team-record three sacrifice bunts, beat out a bunt for a single.

After both runners moved up on Ryan Court’s sacrifice, Freiman singled sharply off the glove of Binghamton third baseman Derrik Gibson.

“I had all the confidence in the world if I just kept putting up zeroes, the guys were going to get us a run,” Haley said. “We were putting good at-bats together. We had a really solid six innings of hitting.”