DURHAM, N.C. -- With No. 5 Duke trailing its fiercest rival and struggling to match the magnitude of the moment, coach Mike Krzyzewski had a simple message for his team. No pressure -- and no set plays, either.

"Take the pianos off your back, quit playing with all the pressure in the world, get a smile on your face," Krzyzewski said. "Just play."

Marvin Bagley III had 18 of his 21 points in the second half along with 15 rebounds, and No. 5 Duke erased a 13-point deficit in the second half and beat No. 9 North Carolina 74-64 on Saturday night.

Greyson Allen added 15 points in his final game at Cameron Indoor Stadium, and Gary Trent Jr. had 13 points -- including three 3-pointers in the final 10 minutes -- to help the Blue Devils (25-6, 13-5) clinch the No. 2 seed in the Atlantic Coast Conference Tournament.

Duke was 8 of 15 from 3-point range in the second half -- the Blue Devils made just 1 of 10 from that distance in the first half -- and outrebounded North Carolina 24-13 after halftime.

"They kicked our butts in the second half," UNC coach Roy Williams said.

Cameron Johnson scored 16 points for the Tar Heels (22-9, 11-7), while Kenny Williams and Luke Maye each had 13. Three weeks after they rallied from a double-figure deficit to win the rivalry's first game, it was the Blue Devils' turn to flip the script.

Duke trailed by 11 with 14 1/2 minutes to play, but once the pressure started to fade, the ACC's top offence finally found its rhythm.

"I'm not going to call any plays," Krzyzewski said he told his team. "If you hit, cut, everybody touch the ball, you see a play to make, you make the play. And get comfortable in the game. And they did that. You could see them do that."

The Blue Devils hit four 3s in 4 1/2 minutes to erase that deficit, and that came early during the 25-10 burst keyed by six 3s that put them ahead to stay.

BIG PICTURE

North Carolina: The Tar Heels had a chance to spoil Duke's Senior Night for the third time in their last four regular-season-ending visits to Cameron, and sweep their fiercest rivals. Instead, after too many missed shots at inopportune times, they'll enter the post-season on a two-game losing streak.

"Played a little timid, and it's hard to win games like that -- playing timid," guard Joel Berry II said.

Duke: This very well might have been the final game at Cameron for a good chunk of the starting five, with Allen -- the team's lone senior -- surrounded by three potential one-and-done freshmen and Krzyzewski acknowledging in the leadup to the game that "it's the last game probably for a few of our other kids, too." The offence came alive just in time to send Allen -- and maybe the others -- out the way they wanted.

KEY STATS

North Carolina, which tied a program record with two turnovers in the previous meeting on Feb. 8, had much more trouble taking care of the ball in this one. The Tar Heels had 14 turnovers and the Blue Devils turned them into 15 points.

COMFORT ZONE

The Tar Heels also set a program record under Williams by taking 33 3-pointers in the first meeting, and put up 31 more in this one against Duke's 2-3 zone defence. But they only made eight -- three after halftime -- and the most conspicuous stat line belonged to Berry, last year's Final Four Most Outstanding Player who finished 0 for 7 from 3-point range. "I don't like shooting 31 3s," Williams said. "That's not who we are."

KEY STRETCH

Duke had missed 13 of its first 14 3s before Trevon Duval and Allen connected on back-to-back possessions near the 13-minute mark and made it a two-possession game. Then, after Johnson missed a 3-pointer, Bagley finished off a pretty feed from Duval for a dunk that pulled the Blue Devils to 46-43 and reclaimed the momentum for good. "Marvin went nuts there for a while and just put us on his back," Krzyzewski said.

HE SAID IT

"Aliens crawled up in my guys' bodies in the second half, because this wasn't the North Carolina team I've seen all year." -- Williams, on his team losing composure in the second half.

UP NEXT

North Carolina: Earned the No. 6 seed in the ACC Tournament and will play the Wake Forest-Syracuse winner on Wednesday night.

Duke: As the No. 2 seed in the conference tournament, the Blue Devils will play either Notre Dame, Pittsburgh or Virginia Tech on Thursday night.