RICHMOND, Va. — Dodging raindrops on a stormy Sunday evening, the Portland Sea Dogs defeated the Richmond Flying Squirrels 7-2, behind the pitching of Alex Wilson and the slugging of Ryan Khoury.

The victory enabled the Sea Dogs (48-66) to avoid being swept by the San Francisco Giants affiliate in their first trip to Richmond. The Flying Squirrels (62-52) won the first two games of the series.

Portland has today off before beginning a six-game homestand Tuesday against Akron.

“We played well all three games and I’m glad the team has a victory to ride back on,” said Sea Dogs Manager Kevin Boles.

Wilson improved to 9-4 with six strong innings. The only run he allowed was tarnished. After Juan Perez doubled to start the second inning, shortstop Heiker Meneses threw low to first on a routine chopper. When Jon Hee was unable to scoop it, Perez scored from second.

Wilson allowed six hits, walked none and fanned five, while hitting the strike zone on 57 of 80 pitches.

Khoury was 3 for 4 with a home run, two RBI and three runs scored.

“Ryan is a grinder,” said Boles. “He brings a lot of energy to this team.”

Khoury jump-started the Portland offense with one out in the first when he drove a Justin Fitzgerald fastball over the fence in center field, more than 400 feet away.

“I had two strikes and got a ball up in the strike zone,” he said. “We’d hit some balls earlier this series we thought would get out, but didn’t. This one carried far enough.”

It was one of the few homers hit to straightaway center this season at The Diamond, a notoriously stingy park for home runs.

“We didn’t want to get swept we don’t think we should get swept — ever,” said Khoury.

Khoury had two hits and three RBI the night before in a 7-5 loss.

Although the Sea Dogs are out of playoff contention, Khoury assures there will be no drop off in effort.

“When you have a bad game, you’ve got to get over it and play your best the next game,” he said.

Portland broke a 1-1 tie with three runs in the fifth, on hits by Meneses, Jeremy Hazelbaker, Khoury, Mark Wagner and Will Middlebrooks.

Middlebrooks’ single, off reliever Edwin Quirarte, drove home two runs.

Portland salted it away in the ninth, getting three more runs on a single by Hazelbaker, a walk to Khoury, a sacrifice fly by Wagner, an error, a double by Middlebrooks and a wild pitch.

By then, a crowd of 7,413 was mostly gone — scared off by thunder and lightning.

Southpaw Cesar Cabral hurled two scoreless innings in relief for Portland, striking out two.

The three-run outburst in the top of the ninth made it easy on Sea Dogs closer Blake Maxwell, who allowed a home run to Jackson Williams before retiring the side.