Keene SwampBats pitcher Michael Bacica throws a pitch during the first inning of the SwampBats' game against the Sanford Mainers Saturday at Alumni Field.

Welcome to Keene, David Williams.

The junior from Saint John’s University played hero Saturday night in the Keene SwampBats’ 4-3, walk-off win over the Sanford Mainers at Alumni Field.

What began as a pitchers’ duel turned into an emotional roller coaster in the final three innings.

The Mainers scored twice in the first inning and held the 2-0 lead until the sixth when Keene's Mikey Edelman scored on an error to cut the lead in half.

David Bryant hit a two-RBI single in the seventh to give Keene the late 3-2 lead, which held until the top of the ninth, when the Mainers loaded the bases and scraped across a run on a wild pitch to tie the game.

But it didn’t take long for the SwampBats to get that run back. Bryant led off the bottom of the ninth with a single and Carlos Guzman reached on an error. Both runners advanced on a wild pitch and the SwampBats faithful started to get loud.

Then Williams stepped into the box and roped a single into left field for the win.

“I had a tough at-bat earlier in the game … so I just made my adjustments, shortened my swing and just put a bat on it,” Williams said. “We knew all along this was our game. We needed to win this one. Rough night last night but quick switch and we just came out tonight and played the game the right way.”

For most of the game, the story was the pitching matchup between Keene’s Michael Bacica and Sanford’s Jacob Edwards, who battled pitch-for-pitch for the first five innings.

Bacica went 5.2 innings and gave up two earned runs on two hits while walking four. The junior from the University of Maine struck out 11 batters.

“He was dealing,” said Keene head coach Shaun McKenna. “He was just mowing guys down.”

“I was just trying to stay relaxed and hammer the zone,” Bacica said. “Felt good all around. It was really fun to be out here in a pitchers’ battle.”

Jacob Edwards pitched five scoreless innings for Sanford, giving up just one hit and striking out six.

Matt Draper came in to relive Bacica with two outs in the sixth inning. Draper finished the sixth and got through the seventh and eighth with relative ease — helped by a double play in the eighth — but got into a jam in the ninth when the Mainers loaded the bases with just one out.

That’s when McKenna turned to Jason Diaz to try and get out of the jam, but Diaz started his outing with a wild pitch that scored the game-tying run.

Diaz kept his composure and got out of the inning without giving up any more runs.

Then Williams and the Keene offense took care of the rest.

“Good group win,” McKenna said. “Everyone contributed.”

Keene (1-1) travels to Goodell Park Sunday for a rematch with the Mainers. Game time is 4:30 p.m.

Chris Detwiler can be reached at 352-1234, extension 1411, or cdetwiler@keenesentinel.com. Follow him on Twitter @Chris_Detwiler.