Rick Barnes is 88-50 in four years at Tennessee, which went 79-57 over the previous four years. (Gregory Shamus/Getty Images)

MINNEAPOLIS — UCLA’s seemingly endless search for a men’s basketball coach goes on.

Rick Barnes will remain as head coach at Tennessee after UCLA offered him its job on Monday — with a five-year contract worth $25 million — but again balked at a buyout, according to people with knowledge of the situation.

Barnes, who has been at Tennessee for four years and on Sunday was voted the Naismith Coach of the Year, has a $5 million buyout. Apparently UCLA was only willing to pay part of it.

Barnes, 64, was torn about what to do for most of the day Monday. Part of him wanted to take on the challenge of rebuilding a fallen dynasty as the last chapter of his coaching career. But another part of him loves it in Knoxville and knows he can retire there as an icon after taking the Vols to an SEC title a year ago and the Sweet 16 this year — twice beating archrival Kentucky along the way. The Vols finished the season with a 31-6 record and held the No. 1 ranking for several weeks.

UCLA’s search has been troubled since Steve Alford resigned on New Year’s Eve. The Bruins, who finished the season 17-16 under interim coach Murry Bartow, approached Virginia’s Tony Bennett, who had no interest in the job. Then they made an offer to Kentucky’s John Calipari for less money than Calipari was making at Kentucky, and Calipari used the UCLA offer to wrangle a lifetime contract in Lexington.

Last week, an apparent deal with TCU Coach Jamie Dixon fell apart because UCLA didn’t want to pay the $8 million it would have taken to get Dixon out of his TCU contract.

It looked as if UCLA had found an answer in Barnes but, with the buyout a sticking point and with Tennessee making a counteroffer that will pay Barnes more money than UCLA, he decided to stay put.

UCLA now goes back to the drawing board. Luke Walton might be a candidate if, as rumored, he is fired by the Los Angeles Lakers this week. Other names mentioned include Louisville’s Chris Mack and Cincinnati’s Mick Cronin.

The Los Angeles Times’s Ben Bolch reported Sunday Bolch reported that UCLA was also interested in Oklahoma Coach Lon Kruger and had interviewed him, but the 66-year-old said in a statement Sunday that he had not had “any contact with anyone from UCLA.”

UCLA Athletic Director Dan Guerrero has taken flak for seeming to bounce from one candidate to another. The search has raised questions of just how desirable the UCLA job really is, given the program’s increasingly distant legacy of enormous success and, as some see it, the expenses and related challenges of relocating to Southern California.

According to Seth Davis of CBS Sports and the Athletic, UCLA “thought it had all but landed” Barnes until Tennessee came back to him with more money. Davis added that if Barnes opts to stay in Knoxville, UCLA will turn back to Cronin.

Read more from The Post:

Updates and recap from Virginia vs. Texas Tech in the NCAA national championship

After missed Final Four calls, Bruce Pearl says everyone needs to ‘get over it’

Baylor edges defending champion Notre Dame for third NCAA women’s title

Josh Rosen rumors swirl around Redskins as NFL draft approaches