For Virginia senior Akil Mitchell, “it was a girl.” For forward Anthony Gill, it was “my defense.”

But whether it was the end of a romantic relationship or a failure to gain a coach’s trust, the two former high school teammates did not seem quite right as the Cavaliers stumbled in nonconference play.

Now, though, with Virginia entering this week’s NCAA tournament as a No. 1 seed, they have become a well-rounded duo Coach Tony Bennett has increasingly turned to in crunch time.

Mitchell is the 6-foot-8 defensive captain, a vocal leader capable of shutting down a team’s best post player and defending multiple positions.

Gill provides the offensive punch, gaining confidence — and more minutes — with each aggressive post move.

“We’ve got pretty good chemistry,” Mitchell said this week. “We have for a number of years now.”

Mitchell proved to be Gill’s biggest recruiter when he elected to transfer to Virginia from South Carolina in April 2012, even though Gill could potentially steal some of his playing time.

They had become close at Charlotte Christian School, separated by one year on a team that also included future Duke star Seth Curry.

But the autumn proved to be a confusing time for Mitchell, a third-team all-ACC selection a year ago. He broke his hand during the LeBron James Skills Academy in July, missed offseason workouts and struggled to embrace a role that diminished his offensive impact.

Coaches wondered whether he was trying too hard to impress NBA scouts. The breakup only made things worse.

“It was her, it was the hand, it was family issues, it was not being able to work out,” Mitchell said. “It was just one more thing that kind of frustrated me. [Basketball] is what I love to do, so if I’m not happy . . . then I think it shows on the court.”

Like the rest of the team, Mitchell emerged from his funk after Virginia suffered an embarrassing 35-point loss at Tennessee on Dec. 30.

He began to focus on defense and rebounding, where the Cavaliers needed him most, instead of trying to create his own offense. His stats (seven points and 7.1 rebounds) may have taken a hit, but his contributions have been invaluable.

It culminated last week, when Mitchell earned a spot on the all-ACC defensive team and showed he’s one of the nation’s elite defenders with what Bennett called a “special” performance going head-to-head against Duke’s Jabari Parker in Sunday’s ACC tournament final.

“You think you can defend until you get here and you’re trying to figure out the pack-line [defense] for your first two years,” said Mitchell. “I never imagined myself being this kind of defender.”

Gill could relate. After dominating on Virginia’s scout team while sitting out last season because of NCAA transfer rules, he received only sporadic playing time once he was cleared to play.

Talent, though, was not the problem for a player whom leading scorer Malcolm Brogdon said “could start on this team easily, or any team in the country.” Even in November, he scored a season-high 19 points in a win over Southern Methodist.

But Bennett simply didn’t trust him yet, not when Gill couldn’t avoid defensive breakdowns.

“Offensively, I’ve always been in a comfort zone,” Gill said. “I have to learn the pack-line. I’m still learning to this day, the pack-line, what Coach Bennett wants from me at what time. Whenever I’m not on the court, it’s because of my defense.”