BREWER, Maine — The Old Town High School softball team appeared to be in deep trouble.

York had broken a scoreless tie with three runs in the top of the fifth inning in their state Class B softball game at Coffin Field and the Wildcats’ ace righthander, Stephanie Rundlett — who struck out 239 in 90 innings during the regular season — was working on a perfect game.

But Caitlyn King hit the first pitch in the bottom of the fifth to the base of the fence for a double to trigger a string of four consecutive hits as the Coyotes rallied for four runs and went on to post a 6-3 triumph.

“Caitlyn’s hit turned the game around,” said Old Town coach Jenn Plourde. “That gave us the momentum we really needed.”

The title was the first for the 17-3 Coyotes since 2012 as they snapped York’s 18-game winning streak. The Wildcats finished 18-2.

King’s double was the first ball hit by Old Town out of the infield in the game, as Rundlett struck out eight of the first 12 hitters she faced.

“It was a pitch right down the middle,” said King, who reached third on an ensuing throwing error.

Mikayla Richards then grounded a sharp RBI single to center.

Lauren Gasaway reached on a bunt single and, following a double steal, Kayla Hayward tied it by lining a two-run double inside the left-field line.

“I was originally going to bunt but I fouled it off,” said Hayward. “I heard the whole town and my teammates cheering for me so I knew I had to make contact.

“She threw me a low inside pitch and I hit it.”

Hayward moved to third on Olivia Westura’s sacrifice and scored when Natalie St. Louis ripped a two-out opposite-field single to right.

“My rises and curves started going straight that inning and that made them easier to hit,” said Rundlett, who is now 16-1 and will be a scholarship pitcher at Fordham University in New York next season.

The Wildcats had a golden opportunity to tie it in the sixth when they got runners on second and third with one out but Old Town freshman righthander Olivia Albert induced a pop-up and a groundout to end the threat.

“There may have been a little letdown after we got the three-run lead,” said York coach Mona Blais. “(Rundlett’s) spins weren’t as tight and they were seeing her the second time around. We had one bad, bad inning.”

Albert made it 5-3 by opening the bottom of the sixth with her second homer of the season, a blast to center field.

“I know it came off the bat real good but I didn’t know if it would carry,” said Albert.

King followed with a single and eventually scored on a throwing error.

York took a 3-0 lead in the fifth on singles by Terra Pepin and Elise Holly, Kiley Blondin’s two-run double to right and Rundlett’s RBI fielder’s choice.

Albert was touched up for 12 hits but allowed just the three runs in posting her fourth playoff win.

“I did pretty well. I hit my spots. But the defense really came through,” said Albert, who struck out five and walked one while throwing 107 pitches, 75 for strikes.

Rundlett allowed seven hits while striking out 11 and not walking anyone.

“She was really, really good. She had a great rise ball,” said Albert.

King doubled and singled for Old Town while York received a double and two singles from Rundlett and two singles apiece from Pepin, Holly and Maeve Campbell.