MADISON — The last time the Winslow High School football team was in Madison, it left with its first loss in more than two seasons. This time, the Black Raiders are leaving for the conference championship game.

With a run-stuffing defense and a ball-control offense, Winslow took a 41-21 win over Madison on Friday night, avenging its only loss since 2013.

“We were ready to play tonight,” said Winslow defensive end Ryan Fredette, who capped the game with a sack of Madison’s Evan Bess in the end zone for a safety in the final minute. “The last time, we came out flat.”

No. 3 Winslow, now 9-1, will play at No. 1 Mt. Desert Island (8-1) next week in the Class C North final. No. 2 Madison ends its best season in decades at 7-2.

In the previous meeting, Madison jumped out to a 21-0 lead. That didn’t happen this time, as Winslow capitalized on a Bulldog fumble on the second play of the game. Nate St. Amand’s 5-yard touchdown run with 5:31 left in the first quarter gave the Black Raiders a 6-0 lead.

Quarterback Ryan Gagnon scored on a 1-yard keeper with 9:23 left in the second to push Winslow’s lead to 14-0, and after recovering another Madison fumble Winslow made it 17-0 when Gagnon drilled a 31-yard field goal.

Using a 3-3 stack defensive formation, Winslow completely stuffed the Bulldogs’ run game. Madison was held to minus-20 yards rushing.

“Our defensive staff came up with a real nice game plan,” Winslow coach Mike Siviski said.

“The 30 stack is something I know they’ve done in the past,” Madison coach Scott Franzose added. “We knew how to handle it. We just didn’t get it done.”

The Bulldogs found some success through the air. Bess connected with Sean Whalen for a 19-yard touchdown to cut Madison’s deficit to 17-7 at the half. With 5:02 left in the third, Bess hit Mitch Jarvais (four catches, 84 yard) for a 21-yard touchdown, cutting Winslow’s lead to 24-13. With 15 seconds left in the third, Bess found Whalen (four catches for 115) again, this time for a 52-yard touchdown, making Winslow’s lead 32-21.

Bess threw for 205 yards.

“We had some pretty good pressure and he still completed the passes,” Siviski said.

Madison’s defense had no answer for Winslow’s ground game. St. Amand ran for 154 yards and two touchdowns. Fullback Kenny Rickard ran for 119, and his 3-yard touchdown run with 4:30 to play gave Winslow a 39-21 lead.

The Black Raiders ran for 418 yards. Patrick Hopkins added 57 yards, while Dylan Hutchinson ran for 63, including a 58-yard touchdown in the third quarter.

“It felt like they were hungry,” Franzose said. “They’re a Winslow team, and we knew they were going to be physical.”