NEW YORK (AP) College basketball's biggest rivalry is coming to Brooklyn.

No. 14 Duke rallied from 12 points down in the second half, getting an emotional lift from a revitalized Grayson Allen, to beat No. 10 Louisville 81-77 Thursday and set up a semifinal match with No. 6 North Carolina.

''We're two of the great programs. We're accustomed, they're accustomed to playing in buildings that have a lot of energy, for or against them,'' Duke coach Mike Krzyzewski said. ''So to be in that moment (Friday), the people who were in the stands, they have a chance to enjoy that because those moments don't happen all the time. Our two programs have created a lot of them.''

Separated by about 10 miles, Duke (25-8) and North Carolina are one ACC Tournament title apart for most in the conference. Duke has won 19 and North Carolina 18.

Duke is 12-8 against North Carolina in the ACC Tournament, but the Blue Devils have not met the Tar Heels in the tourney since beating them in the 2011 title game.

This will be only the fifth time they have played outside the state of North Carolina. Three times they have played in the ACC Tournament in Atlanta, and in 1971, North Carolina beat Duke in the NIT semifinals at Madison Square Garden. Game 245 in the rivalry will be played in the borough where Michael Jordan was born, with a trip to the ACC Tournament finals on the line.

The teams split this season, with each winning on its home floor.

''The atmosphere will be great, the fans will be great,'' Duke's Luke Kennard said. ''We have great fans who travel with us, they have fans who travel with them.''

The crowd at Barclays Center for the early session Thursday was mostly covered in the schools' two shades of blue. The top-seeded Tar Heels advanced to the semifinals by beating Miami 78-53 in the early game.

The Blue Devils had a much more challenging game against Louisville (24-8).

''So that was a quarterfinal game?'' Krzyzewski said. ''Holy mackerel. Wow, that was a big-time game.''

Jayson Tatum scored 25 points to lead the Blue Devils. Kennard had 24, including some big 3s down the stretch, and Allen added 18 in his best performance in a month.

BIG PICTURE

Duke: Every move Allen makes gets scrutinized since he was suspended earlier this season for tripping an opponent for the third time in his career.

The junior guard drew technical fouls in each of his last two games, including a scoreless outing in 12 foul-troubled minutes against Clemson on Wednesday.

Against Louisville, Allen, who has been nursing a sore ankle, played like his old self.

''We really needed a spark off the bench, and I didn't think I did a good job of that in the first game,'' Allen said.

He was booed by opposing fans every time he stepped on the floor, especially with so many North Carolina fans scouting out their next opponent. Duke fans tried to drown it out with cheers.

''I love Grayson,'' Krzyzewski said. ''Grayson, I got his back all the time. And everyone in our program has his back all the time. The public eye on our program is a blessing and can be a curse. So we have to be able to deal with all of it.''

Allen was fouled shooting a 3 with 8:58 left, a call that got about equal parts boos and hoots. As he shot his free throws, there were boos. After each make, cheers. He cut the lead to 64-61 by the time he was done and then went to the bench where his teammates all got to their feet to greet him with hand slaps and pats on the back and head.

''Well, for me, energy produces energy,'' Krzyzewski said. ''I think we already had energy, and people saw it. And then Grayson has played for three years all out. All out. All out. That was another example of it, and his teammates and everyone responded.

''And the people who don't want us to win, they responded. God bless everyone. But energy produced more energy.''

Louisville: Deng Adel scored 21 points for fourth-seeded Louisville, which led by a dozen with 13 minutes left but struggled from the free-throw (15 for 26) and 3-point lines (4 for 21). The Cardinals had a chance to tie it late, but Quentin Snider missed a shot with 4 seconds left as he leaned into a defender trying to draw contact.

''I'm heartbroken we lost today,'' Louisville coach Rick Pitino said. ''We have got to cure these free-throw shooting woes.''

Any hope Louisville had of grabbing a No. 1 seed in the NCAA Tournament is gone.

''We lost a game mentally tonight a little bit,'' Pitino said.

MILESTONE FOR K

Krzyzewski earned his 59th ACC Tournament victory to pass North Carolina's Dean Smith for the most in conference history.

UP NEXT

Louisville: Will find out its next opponent on Selection Sunday.

Duke: How close are the Blue Devils and Tar Heels when it comes to ACC domination? They are both 97-44 in ACC Tournament play, tied for the best record in the 64-year history of the event.

---

Follow Ralph D. Russo at www.Twitter.com/ralphDrussoAP

---

More college basketball coverage: http://collegebasketball.ap.org

Copyright 2017 by Associated Press. Any commercial use or distribution without the express written consent of Associated Press is strictly prohibited.