The final play of the Class A girls’ soccer state championship game couldn’t have been scripted any better for Charlotte Messer.

Messer, a senior captain for Camden Hills and the daughter of the coach, pounced on a rebound after Gorham keeper Emma Smith punched out Eliza Roy’s corner kick in overtime.

The ball went right to Messer, and she popped a shot over Smith and a Gorham defender into the top corner of the net to give Camden Hills a 1-0 victory.

It’s the first state title in Meredith Messer’s 21 years as coach, and it came at the expense of a previously undefeated opponent.

Messer’s 26th goal of the season also tied Emma Gutheinz’s school scoring record.

“It was exhilarating. That is the best word I can use to describe it,” said Charlotte Messer, who is very familiar with Smith, as the two are teammates on the Seacoast United Maine travel team.

“I was sitting on the 18 (yard line), and when (Smith) cleared it I happened to be in the right place at the right time.

“I think it’s a vision of every soccer player (to get the winning goal). It’s kinda like a dream.”

Coach Messer wasn’t surprised that a set play determined the outcome.

“Dead balls in a game like this can make all the difference,” she said.

She added that her first championship as coach was even more special with her daughter on the team.

“I think what makes it so special is seeing it is (a team) with my daughter; this group of girls has had slumber parties at my house and I’ve seen them going to dances. I think that personal relationship makes it all that more special,” she said.

It was an unfortunate end to Smith’s final varsity game, as she kept her team in contention with 13 saves, including eight in the first half, when Camden Hills (17-1) dominated with a 10-3 shot advantage.

Gorham (16-1-1) didn’t put a shot on goal until just after the midway point, as the Windjammers – who tallied 109 goals this season – kept the ball in their offensive end. Smith constantly came out to challenge shots and thwart scoring chances.

“(The winning goal) wasn’t going to be an easy goal for them to score. We weren’t going to let it go in easily,” said Smith.

“I would have had to be 6 feet tall to save that goal.”

Smith’s counterpart, Isabelle Lang, was equally up to the task. Her biggest play came with less than 30 seconds remaining in regulation when she came out to cut down the angle on Hallie Shiers’ low shot from the right side of the box. She then got help from Camryn Langille, who cleared the ball as it was nearing the goal line at the far post.

Seven minutes earlier, Lang barely beat Gorham’s Tiril Wiig to the ball as the two were going for a through ball served by Shiers.

“I came in knowing they are a very good team,” Gorham Coach Jeanne Zarrilli said. “They had a plan and they executed it very well. They stayed composed, used each other and played as a team.”

Gorham was looking for its first state title since 2007, when it secured its third straight. The Rams also lost in last year’s state final, 2-0 against Bangor.

“Not putting one away was very frustrating,” said Zarrilli.