DURHAM, N.C. – Ryan Kelly had waited two months for the chance to help his Duke teammates reclaim the form that made them the nation's top-ranked team.

He returned with a stunning performance that shook up No. 5 Miami and left his own Hall of Fame coach struggling for the right words.

The senior scored a career-high 36 points in his return from a foot injury that had sidelined him since January, helping the third-ranked Blue Devils beat the Hurricanes 79-76 on Saturday night in a matchup of the Atlantic Coast Conference's top teams.

"I guess I was ready for it," Kelly said. "That's all I can say."

Kelly knocked down 10 of 14 shots - including 7 of 9 3-pointers- for the Blue Devils (25-4, 12-4 ACC), who avenged a blowout road loss in January by grinding out a tough win in Cameron Indoor Stadium. He also went 9-for-12 from the foul line and pulled down seven rebounds in 32 minutes.

It left Duke coach Mike Krzyzewski joking to reporters that he was interested to read how they'd describe Kelly's big night.

"I mean, me saying `spectacular' or whatever doesn't do his performance justice," Krzyzewski said. "One for the ages. Probably as good a performance as any player has had - a Duke player has had - in Cameron."

Kelly's performance was the highlight of a game that certainly lived up to the teams' lofty rankings and their status as the league's best. Miami led by seven in the first half and by two at the break, while Duke never led by more than five until the final 3 minutes.

Quinn Cook added 15 points, including a 3-pointer that gave Duke a 10-point lead with 1:55 left.

But the Hurricanes (23-5, 14-2) made a frantic rally and missed two 3s in the final seconds to tie it. Shane Larkin came up short on the first over Kelly. Durand Scott ran down the rebound and fired a pass to the left corner to Rion Brown, whose final 3 clanged off the rim as the horn sounded.

Kelly's season-high was 22 points and his career-best was 23 points before Saturday. He had missed 13 straight games with the right foot injury, though he had been gradually increasing his work in practice in recent days before going right back in the starting lineup Saturday.

"I just knew I was going to play my hardest," Kelly said. "Honestly, though, more than anything it was just going to be whether I could hold up with my breathing. I haven't played any games in a long time, and being in a game is a lot different from being in practice or anything you can do. But I think I held up all right."

He missed a 3 on Duke's first possession, but knocked one down 2 1/2 minutes in and never looked rusty.

"Well, I thought we prepared for Ryan Kelly but obviously not for that Ryan Kelly," Miami coach Jim Larranaga said. "He was sensational from start to finish."

Miami had beaten Duke 90-63 in January and had already clinched at least a share of the ACC regular-season title with the Blue Devils' loss at Virginia on Thursday night. Miami will win its first ACC crown outright by beating either Georgia Tech or Clemson at home this week.

But Saturday's game was about more than just the league standings or the chance to avenge that blowout loss for the Blue Devils. Rather, this was their chance to reclaim some momentum for March with Kelly's return.

"The thing (the win) does for us is it gives us a chance over the next few weeks to transition to the NCAA tournament," Krzyzewski said. "We're just running a little bit different race than anybody else right now. And it doesn't mean everything's OK, but it's a lot better."

Duke was unbeaten with nonconference wins against Kentucky, Louisville and Ohio State when Kelly went down against Clemson in January. It was during Kelly's absence that Duke suffered 27-point loss at Miami on Jan. 23, a game that saw the Hurricanes romping unchecked through Duke's passive defense and even slapping the floor in an apparent jab at the Blue Devils' tradition.

The 6-foot-11 forward was averaging 13 points and five rebounds, and stretched defenses with his outside shot to open space for Mason Plumlee inside.

Fittingly, he started the spurt that finally put the Blue Devils ahead for good. First he hit a pair of free throws, then knocked down a 3-pointer over Kenny Kadji with the shot clock winding down to push Duke to a 58-56 lead with 9:13 left. Plumlee followed with a short hook to cap the 7-0 run for a 60-56 edge.

Duke extended its lead with another 7-0 burst, with freshman Rasheed Sulaimon scoring a pair of driving baskets before Cook's 3 that appeared to have Duke in control.

Miami fought back, getting a 3-pointer from Trey McKinney Jones to make it a one-possession game with 1:06 left. But in addition to those late misses, Larkin also had a costly turnover when he threw away a sideline pass to Brown with Miami trailing by just two with about 30 seconds left.

"This is the type of game that everybody lives for," said Durand Scott, who scored 12 for the Hurricanes. "You can't really get mad at this. We went out there, we played our hardest, we're proud of ourselves, and our team did the best that we could. We just fell short a 3."

Duke shot 52 percent, with Kelly's big day offsetting Seth Curry's struggles (seven points on 2-for-8 shooting) and Miami's domination on the boards that led to a 20-4 edge in second-chance points.

Larkin scored 25 points to lead Miami, while Kenny Kadji added 17 points and 10 rebounds. But big man Reggie Johnson had a miserable night by going scoreless on 0-for-5 shooting and picking up his fourth foul in the first minute after halftime.