INDIANAPOLIS — Nobody will accuse these Kentucky kids of being the fastest learners. Not this season. And certainly not during most of Friday night’s game against Louisville.

But once again, late in the game with everything on the line, they figured things out just in time.

Aaron Harrison hit a three-pointer for the go-ahead score with 39 seconds left and Julius Randle made two clutch free throws to lift the fantastic freshmen of Kentucky to a 74-69 victory over their in-state rivals.

The eighth-seeded Wildcats (27-10) led for a grand total of 65 seconds in this Midwest Regional semifinal. They’ll play Michigan on Sunday for a trip to the Final Four.

“I told them before the game, you’ll get punched in the mouth and you’re going to taste blood,” Kentucky coach John Calipari said. “You can fight or you can brace yourself for the next shot. They fought.”

Fourth-seeded and defending champion Louisville ends its season at 31-7.

Few expected a run this deep for the Wildcats as this season played out and their five freshman starters struggled to play a team game. But they’ve been learning slowly. They trailed by 13 midway through the first half, then by seven with 4½ minutes left.

Suddenly, things kicked in.

Actually, it was a sophomore, Alex Poythress, who scored five points and blocked a Russ Smith layup attempt during a 7-0 run that tied the game at 66 with 2:11 left.

“Alex Poythress won the game for us,” Calipari said. “We were begging him the whole game to start playing, and he played at the right time.”

From there, it was the Kentucky freshmen — the Kiddie ’Cats — who showed all the poise against the Cardinals, who were led by seniors Smith (23 points) and Luke Hancock (19).

Harrison took a pass from Randle and spotted up in the corner for the go-ahead shot. Both finished with 15 points, as did yet another freshman starter, Dakari Johnson.

On the next possession, Louisville’s Wayne Black­shear got fouled. The 71 percent career free-throw shooter missed the first. Randle came down and made two free throws to put Kentucky up by three. Harrison guarded Smith and forced him to miss a tough three on the next possession — “His first stop of the game,” Calipari quipped.

A few seconds later, the Wildcats were chest-bumping and Calipari was pumping his fists to a loud stadium that was about two-thirds Kentucky blue, one-third Cardinals red.

Kentucky has now knocked off previously undefeated Wichita State, defending national champion Louisville and has a meeting with last year’s runner-up, Michigan, coming next.

The latest win for Kentucky was the ultimate lesson in patience for a team that, for so long, had trouble showing any. They were touted on T-shirts as the team that would go 40-0 and win the national title, then all head off to the NBA.

Two out of three is still possible.

“They finally have surrendered and lost themselves in the team,” Calipari said. “It’s just taken a long time.”

Louisville coach Rick Pitino, who fell to 11-1 in Sweet 16 games, produced a matchup zone that the Wildcats had trouble working through.

The Cards took the double-digit lead early, yet went to halftime only up three despite holding Kentucky to 33 percent shooting from the floor.

The difference in Pitino’s mind: Louisville went 13 for 23 from the free-throw line while Kentucky went 22 for 27. And the Wildcats had a 37-29 rebounding edge, which also led to eight more second-chance points.

“I told them we probably beat ourselves a little bit down the stretch,” Pitino said. “But how can any of us complain with the run we’ve been on?”