BRUNSWICK, Maine — Coming into Friday’s Kennebec Valley Athletic Conference high school baseball contest, Brunswick had suffered three consecutive one-run losses.

The Dragons needed a “pick-me-up” kind of game, and the Hampden Academy Broncos were the unfortunate recipient of a 2-1 walk-off loss.

Brunswick improved to 4-4 and hosts Edward Little in a key KVAC tilt 4 p.m. Wednesday, while Hampden Academy fell to 2-5 and hosts undefeated Messalonskee on Monday.

Thomas Hanson singled with one out to center field to get the Dragons going with the game tied 1-1 in the home half of the seventh. Cam Berry, who was 2-for-4, beat out a bunt, and Elias Henze followed with a slicing drive to right field that escaped the dive of right fielder Max Thomas to plate the winning run.

“We had those one-run losses, so to get a one-run win today feels good,” said Henze, who had three hits, including a double. “Hopefully this will give us some momentum.”

The fast-moving game featured superb pitching performances from Hampden’s Casey Sudbeck and Brunswick’s Zach Meggison. Sudbeck threw just 71 pitches while Meggison was even stingier, delivering a mere 61 pitches to the dish in his 6.2 innings of work.

“In two games that Zach has started, he has thrown incredibly well,” Brunswick coach Luke Potter said. “He has given up three runs total, none earned, and he just gives the teams something to hit and gives our defense a chance to make some plays. He threw 61 pitches. Are you kidding me? That is awesome.”

“I wanted to hit the outside corner and not give them anything right down the middle,” Sudbeck said after allowing nine hits and striking out two. “I didn’t want to throw 20 pitches an inning. It is still early, and we have times to turn things around. We hope to finish strong.”

“I was dealing today and just had a great team behind me that did all the work,” said Meggison, who permitted two hits, walked one and struck out three. “This is a lot of momentum going forward for us.”

The Broncos claimed a 1-0 lead in the second inning without the benefit of a hit. Brendon Smith reached on a two-out Brunswick error, stole second and moved to third when Tommy Farrar struck out but sprinted to first when the ball slipped away from the Dragons catcher. Farrar immediately sprinted for second and stayed in a rundown long enough to allow Smith to scamper home.

Brunswick answered in the third. Berry singled and moved to second on a balk. Berry made it to third when Henze lifted a fly ball to right field. The throw to third bounded out of play, allowing Berry to score an unearned run for a 1-1 deadlock.

The game remained tied as Meggison kept the Broncos off balance. Hampden’s best chance to score again came in the fourth. Jordan Dysart reached on an error, and Billy Campbell dumped the Broncos’ first hit to left-center field to put two runners into scoring position. But Meggison induced a ground ball to end the frame.

On the other side, Brunswick had one hit in each of the first six innings. John Parker tripled to open the fourth, but two ground balls back to Sudbeck and a fly out kept him 90 feet from home plate. Henze doubled in the fifth, while Parker, who was 2-for-3, singled and advanced to second on a wild pitch in the sixth.

“Guys are squaring up and hitting the ball hard but just right at people,” Potter said. “We just had to stay with it and we did.”

Farrar singled with two outs in the seventh. Potter decided to go with reliever Parker, who proceeded to strike out the next Hampden hitter on three pitches to end the frame, setting up the dramatic ending for the hosts.

Game summary

Hampden — 010 000 0 — 1-2-2

Brunswick — 001 000 1 — 2-9-2.

Casey Sudbeck and Jordan Dysart; Zach Meggison, John Parker (7) and Bobby Lewis.

Double — (B) Elias Henze.

Triple — (B) John Parker.

Repeat hitters — (B) Elias Henze (3), John Parker, Cam Berry.

Records — Brunswick 4-4, Hampden Academy 2-5.