MIAMI (AP) --Giovani Bernard ran for two touchdowns and North Carolina survived a slew of penalties to beat Miami 18-14 Saturday, handing the Hurricanes their first Atlantic Coast Conference loss.

Bernard scored on runs of 10 and 17 yards for the Tar Heels (5-2, 2-1). It was the fourth straight win for North Carolina, which was penalized 15 times.

Mike James and Stephen Morris each had touchdown runs for Miami (4-3, 3-1), which may have lost more than a game. Morris, Miami's quarterback, was helped off the field with 8:26 remaining after apparently hurting his left ankle. He had a large icepack strapped to the ankle shortly afterward and did not return.

Backup Ryan Williams was called in and threw an incompletion on fourth-and-6 from the North Carolina 26 with 5:45 left. North Carolina took nearly four minutes off the clock before punting to Miami with 1:47 left, then held on from there.

With Williams running the show - after Morris' ankle was wrapped in a boot and he left the game - the Hurricanes got to the North Carolina 29 with just under a minute left. But Miami gave up a sack to North Carolina's Tommy Heffernan with 38 seconds left, knocking the Hurricanes back to the 35.

Two plays later, Miami turned the ball over on downs - and now four teams have one loss in the ACC Coastal race.

For Bernard, who played his high school football at nearby St. Thomas Aquinas in Fort Lauderdale, it was a long-awaited homecoming - and he didn't disappoint.

His second touchdown came with 2:57 left in the first half, the second in a pair of brilliant plays by the Tar Heels. Bernard got loose to catch a 17-yard pass from Bryn Renner on fourth-and-6 from the Miami 33, a play where the Hurricanes nearly had a stop - and one that left defensive coordinator Mark D'Onofrio punching the air in disappointment.

His mood soured even worse just seconds later when Bernard quickly went in from 17 yards out, sending the Tar Heels into the half with a 15-7 lead. North Carolina got a two-point conversion after that score, catching the Miami defense off-guard with a quick snap.

The first omen of trouble for Miami came on its first drive. The Hurricanes kept the offense on the field for a fourth-and-1 at the North Carolina 46, only to have left tackle Malcolm Bunche jump offsides. And on Miami's next possession, a pass by Morris bounced off James' hand, caromed into the air and was picked off at the North Carolina 20 by Shakeel Rashad.

North Carolina cashed in only one of those mistakes - Bernard went in from 10 yards out to cap the opening Tar Heels' drive: a seven-play, 61-yard waltz with nary any resistance from the Hurricanes.

It stayed 7-0 until the midpoint of the second quarter, though easily could have been much worse. Renner was picked off by Miami's Eddie Johnson near the goal line on one possession, and Casey Barth missed a 33-yard field goal into a swirling wind with 10:53 left in the half.

A roughing-the-kicker penalty on a Miami punt gave the Hurricanes a break, and James plowed in from a yard out to tie the game at 7-all with 5:21 remaining.

Morris scored from 5 yards out with 5:06 left in the third to end a 12-play, 94-yard drive and get the Hurricanes within 15-14 - a sequence where Miami apparently wanted to try going for a two-point conversion as well. But officials flagged the Hurricanes for snapping the ball too quickly, and Miami settled for just an extra point.