HARRISONBURG, Va. — Joe Harasymiak has his program close to where he wants it.

“We’re trying to get to the point in our program to where we beat teams like James Madison,” the second-year Maine coach said.

It just didn’t happen Saturday, when James Madison pulled away to a 28-10 victory before a sold-out crowd of 25,330 in a Colonial Athletic Association game at Bridgeforth Stadium.

But when Maine running back Josh Mack sprinted past the top-ranked Dukes’ defense into the end zone for a 60-yard touchdown, the Black Bears grabbed a third-quarter lead and showed they were capable of competing with the defending FCS national champion.

Then, clinging to its three-point lead, Maine gave up a 22-yard touchdown pass from Bryan Schor to David Eldridge later in the quarter and never quite recovered.

Top-ranked James Madison (4-0, 1-0) added two touchdowns to put it away.

“Thought we had chances there in the second half but it kind of got away from us,” Harasymiak said.

Maine (1-2, 0-2) drove toward midfield a few times after Eldridge’s touchdown catch, but when freshman quarterback Chris Ferguson had a pass intercepted by Rashad Robinson late in the third, the Dukes found an opportunity to separate.

After the interception, Schor found running back Taylor Woods moving out of the backfield for a 9-yard touchdown pitch and catch. No defender was within 10 yards of Woods, who trotted untouched into the purple-painted turf after securing the catch.

“That was a big turning point in the ball game, and that was a big-time play by (Robinson),” James Madison Coach Mike Houston said. “That wasn’t just that the quarterback made a mistake, but (Robinson) made a great read and acrobatic play on the ball.

“That’s a big-time play.”

Robinson’s interception was the second of three that Ferguson threw against constant pressure.

Ferguson was sacked four times, twice by linebacker Kyre Hawkins. Two of the three interceptions came on third down.

James Madison’s defensive plan included rattling the freshman quarterback. Ferguson finished 20 of 41 for 162 yards and the three interceptions.

“I have to watch the tape, but I thought there were a lot of times when (Ferguson)held onto the ball way too long,” Harasymiak said. “Throughout the game, he probably just needed to get rid of the ball, but that’s what happens when you see great defenses.

“You probably start to see things that you’re not supposed to see and that maybe aren’t even there.”

Though the second half didn’t go the Black Bears’ way, the first half was more than competitive.

Maine became the first team to hold James Madison scoreless in the opening quarter since Colgate did it in December 2015.

Black Bears linebacker Sterling Sheffield racked up eight tackles, 2.5 sacks and an interception of Schor to help keep the Dukes’ offense in check.

Sheffield’s interception came late in the first quarter.

“I was lucky to be in the right position for that interception,” Sheffield said. “Schor is a great quarterback and being able to pick him off is pretty big.

“I feel like momentum changed, but that it didn’t change enough.”

Mack finished with 144 rushing yards and the touchdown.

Harasymiak said James Madison is built to outlast opponents.

“We’re knocking on the door,” Harasymiak said.

“We just got to keep working and keep grinding.”

JMU will stay in conference play next week when it travels to Delaware. Maine will be off after its scheduled game at Central Florida was canceled as part of rescheduling following Hurricane Irma.