North Carolina's A.J. Blue scores in the second quarter to give UNC a 21-14 lead. (Robert Willett/AP)

With bowl eligibility out of the question, the result of a seemingly endless series of injuries combined with a brutal November schedule, the Maryland football team played for pride in the season finale Saturday against North Carolina. And the Terrapins nearly pulled off a stunning upset at Kenan Stadium, but left with an all-too-familiar result: a 45-38 loss, the team’s sixth straight to close the season and the careers of Maryland’s 17 seniors.

“I told them at the hotel today, before we came to the game,” said Coach Randy Edsall, his eyes red during an emotional postgame news conference. “The one thing I said, I asked the seniors to go out and lead us and get us a win today. They came oh-so-close. Like I said, there’s a lot of hurt in that locker room.”

Propelled by 24 unanswered points in the third quarter, the Tar Heels (8-4, 5-3 ACC) pulled away, ending a Maryland season likely to be remembered for the avalanche of injuries that left the Terps (4-8, 2-6) without their leading rusher, leading tackler, team leader in sacks and four scholarship quarterbacks.

The depleted roster was old news. After all, linebacker-turned-quarterback Shawn Petty has been under center ever since the Georgia Tech game on Nov. 3.

But nearly shocking an ACC opponent with a rejuvenated offense on the road? Well, that was new.

Edsall “told us how much he loved us, how unfair it was the stuff we’ve been through,” senior A.J. Francis said. “He said nobody in the history of football has gone through what we’ve gone through this year, injury wise, and probably no one ever will. He said he loves us, and next year when they go to a bowl game, we’ll get all the gifts they get, because we deserve it.”

A Maryland attack that hadn’t topped 30 points since the second week suddenly found itself with firepower, racking up over 300 yards by halftime and surging to a seven-point lead. In a 34-second stretch spanning the break, the Terps scored three touchdowns, stunning the 44,000 chilled, powder blue-clad souls. Brandon Ross broke off a 71-yard run and wide receiver Stefon Diggs threw a touchdown pass to Matt Furstenburg. Petty fit passes into pinholes and redshirt freshman Nigel King made two twisting, one-handed catches.

The 14-0 margin North Carolina built up less than three minutes into the game — on drives that lasted 42 and 31 seconds — seemed a distant memory.

“I told the players, when it was 14-0 people watching this game said Maryland will quit,” Edsall said. “What do they have to play for? But that’s not who we are, and not what this program stands for and represents. It would have been real easy for them to lay down.”

With 21 seconds left before halftime, Anthony Nixon recovered a muffed squib kick. Then, on the next play, Kevin Dorsey tumbled head-over-heels into the end zone for a 28-yard score to give Maryland its first lead since the Boston College game on Oct. 27. Diggs then took the second half’s opening kickoff 99 yards to the end zone, putting the Terps up 35-21.

“The last game of the season, we’re not going to a bowl game. Really nothing we’re playing for,” offensive lineman Justin Gilbert said. “But for us to come out like we did, to fight for all four quarters, just shows the type of guys we have, the type of character they have and the fight they have. Get rid of the adversity, put everyone out there with everyone healthy, and it’s a real special group.”

Even for all the ailments and setbacks, here was Maryland, poised for its first win since Oct. 13. But the Tar Heels’ high-powered spread offense found its groove right as the Terps lost theirs. After going up 35-21, Maryland lost seven yards on 14 plays in the third quarter, while the Tar Heels got two touchdown passes by quarterback Bryn Renner (West Springfield) and a one-yard touchdown leap by running back Giovani Bernard that pushed the lead to 10.

As the clock ticked down to zero, the Terps shook hands and untucked their jerseys, trudging into the locker room in single file while fireworks exploded behind the west end zone. Near midfield, a dozen or so Maryland players kneeled in a prayer huddle before the remaining seniors took one photo and walked off together, arms around each other, trying to forget one last near-victory that, like so many others, ultimately got away.