Virginia players celebrate on the bench following a made basket during Saturday’s game against Virginia Tech. (Amber Searls/Usa Today Sports)

When Virginia next steps onto the court to face Miami in a men’s basketball game on Tuesday night, the Cavaliers will do so as the top-ranked team in the country for the first time since 1982.

Virginia ascended to No. 1 in the latest Associated Press poll released Monday despite losing its most recent game on Saturday to Virginia Tech, 61-60, in overtime at John Paul Jones Arena. It was just the second loss this season for the Cavaliers, then ranked No. 2, and their first in the ACC.

Virginia (23-2, 12-1) received 30 first-place votes. Michigan State was second, receiving 21 votes for first. No. 3 Villanova and No. 4 Xavier also received first-place votes.

Villanova was No. 1 in last week’s poll but lost to St. John’s, 79-75, on Wednesday. The Red Storm had been 0-11 in the Big East. Purdue, meanwhile, was No. 3 but lost twice last week.

The milestone for Virginia came unexpectedly for Coach Tony Bennett and his players, who, in the immediate aftermath of the loss that ended the Cavaliers’ 15-game winning streak, spoke in the past tense about perhaps taking over the top spot.

“I just wanted to win,” Bennett said. “It’s like I said, you embrace the challenge and go at it a game at a time. Had we won, you’re right, we would have been ranked number one, and I would have felt, I wouldn’t have felt great. I certainly would have been excited, but again, it’s always about quality of play.

“Sure, it would have been great for everybody, but that’s a small thing. It’s about your quality in how you play and continuing on in the conference race.”

Bennett, according to an athletic department spokesman, was unavailable to comment on Monday, with the team practicing in the afternoon and then departing for South Florida for its final game heading into a week off. After Tuesday, the Cavaliers don’t play again until Feb. 21 in their bid for a third ACC regular season championship under Bennett.

With five games left in the regular season, Virginia owns a 2½ -game lead over second-place Clemson, which it beat in the teams’ only meeting. It also holds the head-to-head tiebreaker over five of the eight schools mathematically alive to finish with the same conference record as the Cavaliers, who have secured a first-round bye in the ACC tournament.

Virginia needs two wins to claim one of the four double-byes in the ACC tournament, which begins March 6 at Barclays Center in New York.

“I think that they’re good enough to win a national championship,” Virginia Tech Coach Buzz Williams said during the ACC’s weekly coaches conference call on Monday, in which Bennett participated shortly before the poll was released. “Entering Saturday, they lost one game. I’d say that’s good enough to be the number one team in the country.”

Advanced analytics, which the NCAA tournament selection committee uses as part of its evaluation of a school’s tournament profile, also support the Cavaliers being ranked first. Kenpom.com, for instance, has Virginia No. 1 overall among 351 Division I programs and first in adjusted defensive efficiency.

In the midst of its best start since 2014-15, when it went 30-4, Virginia is poised to earn a No. 1 seed in the NCAA tournament for the third time under Bennett. Its résumé includes seven Quadrant 1 wins under a new formula the NCAA has indicated it would include when assembling a program’s “team sheet” as part of the selection process.

Quadrant 1 victories are those at home against opponents in the RPI top 30; on a neutral court against teams in the RPI top 50; and on the road against the RPI top 75.

Virginia men’s basketball is the 12th program in school history to be ranked No. 1 in a published poll, according to the athletic department.

The last Cavaliers men’s basketball team to be ranked first had its run end in less than a month, in one of the biggest upsets in college basketball history.

Virginia started the 1982-83 season atop the AP poll, won its opener on Nov. 26, 1982, against Johns Hopkins and reeled off seven more victories before losing to Chaminade, 77-72, during a holiday tournament in Honolulu.

The game ended at approximately 3 a.m. Eastern time, with limited media coverage.

But ESPN “Pardon the Interruption” host Michael Wilbon, then a reporter with The Washington Post, attended because he happened to be on assignment with the Maryland football team, which was playing in the Aloha Bowl on Christmas.

“The 77-72 victory was accomplished by a coeducational school with an enrollment of about 800, a part-time coach, a No. 4 NAIA ranking and 6-7 center Tony Randolph, who attended elementary school in Washington, D.C., and regularly played against Sampson in high school,” Wilbon wrote, referring to Ralph Sampson, the Cavaliers’ 7-4 center and three-time national player of the year.

Virginia, which went on to lose to eventual national champion North Carolina State in the region finals that season, shot just 39 percent against Chaminade.

“We had good effort,” then-Virginia coach Terry Holland said after the game. “We just missed a lot of open shots.”