DURHAM, N.C. — The man with the bullhorn shouted at the Cameron Crazies to push closer together and turn sideways. More students had to fit in the bleachers at Cameron Indoor Stadium for the final ACC regular-season contest between the Terrapins men’s basketball team and Duke on Saturday.

There were 300 more undergraduates outside, the man said, and all of them were going to fit in the stands for the end of a historic rivalry. The stream of blue-clad Duke students started about 90 minutes before tip-off, entering from the muddy tents of Krzyzewskiville, and by the time the “ACC” and “not our rivals” chants began, the legendary gym was packed.

The frenzied Duke students, part of an announced 9,314, watched an epic finish to an ACC staple, as forward Charles Mitchell’s desperate layup attempt with less than two seconds remaining fell harmlessly into a mess of bodies on the floor, and the No. 8 Blue Devils escaped with a 69-67 victory.

In a rare case, a much-ballyhooed matchup lived up to the hype.

“Hopefully in 10 years, this’ll be on ESPN Classic and I’ll be talking to my children, my sister and my mom about how I picked up like three fouls in five minutes,” said guard Dez Wells, who scored all 17 of his points in the second half. “Hopefully, I’ll be looking back laughing at it, but right now it hurts to lose. It was fun. That was so much fun.”

In last week’s run-up to the game, memory after memory was recalled about the Terps-Duke matchups from the early 2000s, when the teams were in the thick of the ACC and national title races. But in 2014, with the Terps scuffling through a .500 season in ACC play, the chances of recapturing the energy and pageantry of Juan Dixon, Jason Williams, Mike Krzyzewski and Cole Field House seemed unlikely.

As Duke built a 10-point lead in the first half, the Blue Devils seemed poised to put together a typical home performance. Entering Saturday, the Terps had lost the previous six matchups in Durham by an average of 19.8 points, including a 41-point embarrassment in 2009. And this season, the Terps have displayed a knack to go cold suddenly and let opponents pull away.

That wasn’t the case Saturday.

Guard Nick Faust threw down a slam off a missed 3-pointer by forward Jake Layman to hush the Cameron Crazies in the highlight of the first half, punctuated by Mitchell stomping his foot to the floor after the dunk. The teams traded runs to enter halftime with the Blue Devils up, 39-33, and it felt like the Terps were solidly in contention entering the second half.

Then, Wells — who has often spoken of carving out his own spot in Terps history alongside the likes of Dixon, Len Elmore and Len Bias — took over. He drove straight at Duke forward Jabari Parker, a projected top-three pick in the NBA draft, for his first points of the game with just less than 13 minutes remaining.

Wells tied the game at 52 with 8:50 remaining, knocking down a free throw for a three-point play after being fouled. From there, the teams traded blows, exchanging the lead six times the rest of the way.

When Wells gave the Terps their first lead at 54-52, Duke forward Rodney Hood answered with two free throws to tie. And after guard Seth Allen hit a layup on the next possession, Duke forward Amile Jefferson responded with one of his own.

With 2:45 left, Wells drained a 3-pointer to put the Terps up, 67-64. They wouldn’t score again, and Parker’s thunderous dunk over forward Damonte Dodd with 77 seconds left would lift the Blue Devils after Mitchell’s shot rolled out.

Instead of leaving Cameron Indoor Stadium weakly as the victims of yet another blowout, this Terps team cemented its place in the history of the rivalry as it ended, albeit with an unsavory result.

“I don’t know how Charles’ shot didn’t go in,” coach Mark Turgeon said. “Call it the Duke gods or whatever. That thing was rolling in, and all of a sudden, it’s rolling out.”

The game will go down in ACC lore as the Terps leave for the Big Ten this summer. Mitchell’s shot balancing on the rim will remain the lasting image of the rivalry, with a packed gym holding its collective breath.

“I thought it was in, but the basketball gods looked out for us,” Hood told Fox Sports Carolinas. “[The ball] was up there for like 10 seconds, in my opinion. I was just waiting in anticipation. I think the crowd helped us a lot with all the noise and kind of shoved it the other way.”

And as the buzzer sounded, the Terps walked dejectedly off the court. Duke coach Mike Krzyzewski sought out Wells. The Cameron Crazies celebrated another triumph over the Terps.

The rivalry in its current form was over, but as it left, it lived up to everything that came before it.