Duke trailed the entire second half until pointer from the right wing as time expired, lifting ranked Blue Devils over No. 5 North Carolina, 85-84.

Rivers finished with a career-high 29 points, while Seth Curry and Ryan Kelly each had 15 for Duke (20-4, 7-2 ACC), which rebounded from a 78-74 overtime loss to Miami-Florida on Sunday.

Harrison Barnes paced the Tar Heels (20-4, 7-2) with 25 points and Tyler Zeller contributed 23 with 11 rebounds as North Carolina had its 31-game home win streak snapped.

"There's no question, the first thing that you have to do is to congratulate Duke. Congratulate Austin on a big-time game and a big-time shot that he made at the end," North Carolina head coach Roy Williams said. "This one hurts. The kids really played and competed and did some very good things."

Duke trailed 43-40 at the break after North Carolina closed out the half on a 14-5 run as Duke failed to record a field goal over the final 5:50 of the first.

The Blue Devils' offensive struggles continued early in the second half, with the Tar Heels using a 14-4 spurt over the first five minutes to jump out to a 57-44 lead.

North Carolina led by at least seven over the next 11-plus minutes and held a 82-72 advantage with 2:38 left in the game after a Barnes jumper.

It looked as if the Tar Heels would just cruise to the victory, but Duke, which attempted 36 three-pointers in the game, fought back with the long ball.

Back-to-back treys by Tyler Thornton and Curry around a North Carolina turnover quickly closed the gap to four, and after another Tar Heels giveaway, Kelly's putback brought Duke within 82-80 with a little over a minute to play.

Zeller was then fouled and made the back end of two free throws to keep it a one-possession game and on Duke's next touch, Kelly threw up a three-pointer from the right wing that was going wide to the left, but Zeller tipped the ball into the net while trying for the rebound.

It was initially called a game-tying three, but the officials gathered and determined it would be a two-point shot, leaving North Carolina with an 83-82 lead and 14 seconds left.

Zeller again made 1-of-2 foul shots at the other end and the Blue Devils took the ball down the court for the final possession.

Rivers then moved around a screen at the top of the key and set up at the right wing. Zeller was playing a little too far off the freshman in defense, allowing Rivers the space to throw up the game-winning three-pointer that found nothing but net as the buzzer sounded.

"We're obviously ecstatic about the win," Duke head coach Mike Krzyzewski said. "We fought like crazy just to stay close and then in the last couple of minutes we got hot."

Game Notes

Duke avoided losing back-to-back games for the first time since February 2009. The Blue Devils are 14-0 after a loss since in that span...North Carolina still leads the all-time series, 131-102...Duke finished the game shooting 14- for-36 from three-point range...North Carolina went 1-for-6 from beyond the arc, but outscored Duke in the paint, 42-14...John Henson had 12 points and 17 rebounds in a losing effort for the Tar Heels.