BAR HARBOR – It took awhile — 27 holes, actually — but Ryan Gay of Pittston is finally in a groove and in position to win the 91st Maine Amateur at Kebo Valley Golf Club.

Gay shot a 2-under 68 on Wednesday to surge atop the leaderboard after two rounds. The final round will be played today.

He is one stroke ahead of 15-year-old Seth Sweet of Madison and Jason Gall of Augusta.

Gall, whose 3-under 67 gave him the lead after the first round, had a 74 on Wednesday. Sweet shot a 73.

“I needed to get under par to get back into the tournament,” said Gay, the 2008 Amateur champ and last year’s runner-up. “I needed to shoot something under par.”

He did, but it didn’t come easy.

Gay, 19, who attends the University of New Mexico, finished the front nine at 2 over after bogeys on the par-4 eighth hole and par-3 ninth.

But he birdied three of the first five holes on the back nine, which helped him grab the lead.

“I missed some short ones on the front,” he said. “I just tried to stay patient throughout the whole round. I knew the birdies would come on the back nine. I had to give myself looks. The putter is there now.”

Sweet said the same putts that helped him shoot a 68 on Tuesday weren’t there Wednesday.

“I was hitting the ball really good,” he said. “I put it on the green but I didn’t make any putts. I didn’t expect to be tied for second before the tournament, but after I shot a 68 I knew I had a shot. I was nervous for the first couple of holes.”

Sweet, the second-youngest golfer in the field, will play with Gay and Gall today. The group is scheduled to tee off at 9:40 a.m.

“We’ll be the young guns,” he said. “It’s a great experience for me. Even if I don’t win, it will be a great experience to play with the last group.”

Sweet had a double-bogey on the par-3 ninth hole, then parred the next five. After a bogey on the par-3 15th, Sweet salvaged his round with a birdie on the par-3 18th.

“It was a nice way to finish, to get some confidence back,” he said. “If I play my game, I can compete. It takes a good putter out here. You don’t have to hit the ball long and I’m not a big hitter, so it plays to my strengths.”

Ricky Jones of Thomaston, a two-time Amateur champion, is four strokes off the lead after a 73.

Also among those making the cut were Chris Hamel of Natanis (148); Michael Nowak of Augusta (149); Shawn Keenan of Lakewood (152); Thomas Bean of Augusta (152); and Tom Chard of Purpoodock (153).

“I haven’t hit the ball well all week,” said Keenan, who shot a 77. “But I survived. I just hope to get out to a better start (today) and survive a few holes on the front nine because I can play well really on the back.”

Gay added that he was eager to play the final round.

“I definitely want to win it,” he said. “I want to get that trophy back.”