NEW YORK—After Louisville started the second half by making seven of its first nine shots and continuing to drive the ball down Duke’s throat to go up 12, it looked like the Blue Devils were not up to match the Cardinals’ intensity for the second time this year.

But Duke showed how much it has grown since early January, ripping off a 16-3 run spurred by a switch to a zone defense to take the lead right back and give itself a chance to upend Louisville down the stretch.

With Grayson Allen, Luke Kennard and Jayson Tatum at their best once again, the Blue Devils did just that and completed their biggest second-half comeback of the season.

Duke’s leading trio combined for 67 points to lead the fifth-seeded Blue Devils to an 81-77 win against the fourth-seeded Cardinals Thursday afternoon at the Barclays Center in the ACC tournament quarterfinals. Kennard scored 10 points in a row to help Duke erase a nine-point deficit early in the second half, before Tatum’s corner 3-pointer put the team up five with 2:24 remaining.

Although No. 10 Louisville cut the lead to one after Tatum—who fouled out with 25 points—threw it away with 24 seconds left and the Blue Devils up three, two Kennard free throws and a missed Quentin Snider jumper sealed the win. The victory saw freshman big men Harry Giles and Marques Bolden play meaningful second-half minutes and Duke play arguably its best brand of basketball since its home victory against North Carolina Feb. 9.

The Blue Devils and Tar Heels will do battle again in Friday’s first semifinal at 7 p.m.

“Today was just joy,” Duke head coach Mike Krzyzewski said. “I had so much fun coaching our team today. I felt like a little kid, man…. They gave everything.”

After the Cardinals (24-8) started the second half on fire by taking advantage of gaping driving lanes, 14th-ranked Duke went to a 2-3 zone for an extended period of time—one of the first times the Blue Devils have used the tactic this season.

The adjustment took away Louisville’s aggressiveness just enough for Duke (25-8) to quickly get right back in the contest, with Tatum and Allen in attack mode and Kennard burying a left wing 3-pointer.

“When all five guys are talking in a defensive stance and trying to get a stop together, that’s when we’re at our best,” Tatum said. “It has to be all five guys. It can’t just be two or three.”

A Tatum free throw put the Blue Devils up 65-64 with 8:06 remaining, but a Deng Adel and-one and V.J. King jumper quickly put the Cardinals back in front. For the second straight day, Kennard came up big in the second half, canning a transition triple to bring the Blue Devils back within one possession. After Tatum free throws tied it again, Kennard rose and fired from the top of the key again to give his team a three-point advantage with 4:52 left.

The Franklin, Ohio, native was tough to guard late in the contest, responding to a Mangok Mathiang jump hook with a mid-range jumper of his own. He added 10 rebounds to go along with his 24 points.

Allen then collapsed the Cardinal defense and fed Tatum in the left corner for his triple that put Duke up by five with about two minutes remaining as the Blue Devils took advantage of several Louisville misses from the free throw line.

Adel led his team with 21 points, but head coach Rick Pitino’s club struggled to finish plays down the stretch against the zone defense and went just 15-of-26 from the charity stripe and 4-of-21 from beyond the arc. The team’s hesitation on offense in the final 13 minutes seemed to give the Blue Devils—playing their second game in two days—a much-needed boost.

“When you see that look, you just know, ‘We can ramp it up just a little more,’” senior Matt Jones said. “It threw them off a little bit, which we needed. Once that happened, we started making shots and things started going our way.”

Duke’s other major energy source in the second half was Allen, who was slashing into the paint and taking jumpers in rhythm without hesitation for the first time since the team’s first game against North Carolina.

After going scoreless for the first time in almost two years, Wednesday against Clemson, Allen was at his best, and it was no coincidence that his team was as well.

“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. “I just attacked the same way and made some shots today—that was really it.”

Although Louisville used a 10-0 run to build a 20-13 lead early in the contest, the Blue Devils answered right back even with Jackson picking up his third foul. Tatum was assertive attacking the rim, finishing with 12 points in the period, and Allen added eight points and a pair of free throws late in the half to give Duke a two-point edge going into the locker room.

The Blue Devils fell behind again, but showed enough fortitude to respond and advance to Friday’s evening semifinal against top-seeded North Carolina—the first matchup between the teams in the ACC tournament since 2011.