Updated

Bryn Renner tied a school record with five touchdown passes, while Gio Bernard ran for 163 yards and a score to help North Carolina beat Maryland 45-38 in the finale for both teams Saturday.

Freshman Quinshad Davis had nine catches for 135 yards and two touchdowns for the Tar Heels (8-4, 5-3 Atlantic Coast Conference), who blew the game open with a dominating third quarter en route to another big scoring output in their first season under Larry Fedora. North Carolina won eight games for the second time in three seasons but is banned from a bowl due to NCAA sanctions.

Brandon Ross ran for 141 yards and a touchdown for the Terrapins (4-8, 2-6), who closed their second straight bowl-less season under Randy Edsall. They led 35-21 after Stefon Diggs' 99-yard kickoff return to open the second half, but UNC scored 24 straight points to take back control.

Renner connected with Davis for a 50-yard scoring pass to start UNC's game-turning charge, then found Erik Highsmith for a 15-yard scoring pass on the next possession to tie the game. Thomas Moore put the Tar Heels ahead to stay with a 22-yard field goal midway through the third, then Bernard — who tallied his fifth 100-yard rushing game this season — scored from 1 yard out to make it 45-35 late in the quarter.

While Renner and the Tar Heels heated up, Maryland's offense — led by converted linebacker Shawn Petty due to a rash of injuries at quarterback — couldn't sustain any drives or come up with a momentum-killing answer. After racking up 304 yards by halftime, Maryland had 14 plays for minus-7 yards with just one first down in the third quarter.

The Terrapins managed a field goal to make it a one-possession game with 3:12 left, but the Tar Heels moved the chains behind Bernard to run out the clock and send Maryland into the offseason with six straight losses.

As the final seconds ticked away, UNC defensive tackle Sylvester Williams — one of the seniors who stuck around instead of transferring after the NCAA sanctions were announced — doused Fedora with a cooler of water to celebrate the win.

There were also a few chants of "ACC! ACC!" from North Carolina fans, a jab at Maryland's announcement earlier this week that it would move to the Big Ten in 2014.

Renner completed 28 of 39 passes for 305 yards for UNC, and nearly had his sixth TD pass of the day when he found Davis for what appeared to be a 10-yard score. But officials reviewed the play and determined Davis was down inside the 1, leading to Bernard's short scoring run.

Petty, Maryland's fifth QB this year, finished with a career-best 208 yards passing in his fourth straight start. Diggs also threw an 8-yard scoring pass on a trick play with 21 seconds left in the first half, the first of three touchdowns in 34 seconds that seized momentum for the Terrapins.

UNC muffed the ensuing kickoff and Petty connected with Kevin Dorsey for a 28-yard score with 4 seconds left in the half, then Diggs capped the flurry with his long kickoff return coming out of halftime.