CHAPEL HILL, N.C. – In three games against Top 30 teams at the NCAA Chapel Hill Regional, fourth- seeded Maine showed it could compete on a big stage against top competition.

But one thing the Black Bears couldn’t do was avoid giving up a big inning early.

No. 3-seed James Madison scored four runs in the second inning and beat Maine 5-2 Sunday in an elimination game at the University of North Carolina.

“We got down a couple a little early, and we were just trying to claw back and we just couldn’t get back in that one at the end,” Maine Coach Steve Trimper said. “It was not for lack of effort or trying. We went out there, we were grinding, and we just fell a little bit short today.”

The Black Bears (33-24) allowed four runs in the first inning of a 4-0 loss to top-seeded North Carolina on Friday. They bounced back with a 4-1 win over No. 2 Florida International on Saturday night, holding the Panthers to three hits.

Because of that victory — Maine’s second NCAA tournament win in 20 years — the Black Bears played James Madison Sunday afternoon for the right to face North Carolina in the regional final at night.

Maine took the lead in the first inning Sunday when Michael Fransoso doubled and scored on an RBI single by Joey Martin. But the Black Bears got only two more hits the rest of the game, an RBI triple by Fransoso in the third inning and a double by Colin Gay in the eighth.

The Panthers (42-18) — who average an NCAA-best 9.2 runs a game — jumped on Black Bears starter A.J. Bazdanes (1-5) in the second inning, helped by three infield hits and a two-run double by Colonial Athletic Association Player of the Year Jake Lowery, who has an NCAA-best 89 RBI.

Freshman Shaun Coughlin replaced Bazdanes and allowed just one run in 51/3 innings, but the damage had already been done.

Evan Scott (4-3) pitched 71/3 innings to record the win for the Dukes, who suffered their worst NCAA tournament loss (14-0) Saturday night against North Carolina but responded with 13 hits Sunday.

While disappointed in the loss, Trimper was excited for his young team to have the experience of competing in an NCAA Regional for the first time since 2006.

America East first-team right fielder Joey Martin was the only senior who played for Maine in Chapel Hill.

The rest of the starting lineup against James Madison included four freshmen, two sophomores and two juniors.

“We do have a good core of our team returning, and being in this environment and playing these types of games leaves that taste in your mouth,” Trimper said. “You want to come back real, real quick.”

Fransoso, who hit two balls off the right-center field wall Sunday, agreed with his coach’s assessment.

“We have a good group coming back and I hope that the guys going to summer ball are going to build off of this and do what they have to do to get better, and when everybody comes back next fall, that’s when we start going for another trip,” Fransoso said. “We know that we can play here and that’s where we want to be.”

NORTH CAROLINA 9, JAMES MADISON 3: Chaz Frank drove in three runs, and the Tar Heels (48-14) pulled away late to beat the Dukes (42-19) and win the Chapel Hill Regional Sunday night.

Tommy Coyle and Brian Holberton added two RBI apiece for the Tar Heels.

They won three games by a combined 27-3 and will host the Fullerton Regional winner next weekend in the super regionals.

Jake Lowery’s two-run homer in the fifth tied it at 3 for James Madison.

North Carolina, which reached four straight College World Series from 2006-09, improved to 15-0 since 2006 in regional games at home.