Weighing in once again on San Francisco’s homeless problem, tech billionaire Marc Benioff will announce Thursday that he is donating $6.1 million to turn an infamously seedy, long-shuttered Tenderloin hotel into housing for formerly homeless people.

The Bristol Hotel on Mason Street will open the doors to its 58 spacious, refurbished rooms in February, and occupants will be chosen from supportive housing facilities. They will have to have lived for at least three years inside one of those complexes, which provide on-site counseling, and show they have become sufficiently financially independent to get a good recommendation from their housing managers.

The rents will range from $500 to $650 a month, and those low prices will be made possible by Benioff’s donation. The idea, he said, is to give the new tenants the best possible chance of saving income, planning for their futures and maintaining full independence.

“This is just the beginning of what I hope will be a parade of the type of investments that have been identified by the Proposition C campaign,” said Benioff, who is co-CEO of Salesforce, the city’s largest private employer. Benioff donated millions of dollars of personal and corporate money to help pass a new business tax this month that would raise $300 million annually for homeless programs. “This project at the Bristol is a great example of that. We can do this.”

Prop. C is in legal limbo until possible legal challenges over its margin of victory are sorted out.

Benioff said that while he was discussing the measure before the election with Mayor London Breed — who opposed it — she asked him to help with the Bristol. He quickly agreed to donate the money with his wife, Lynne Benioff.

“When you give a person a home, everything gets better,” Benioff said. “It’s the fundamental catalyst to improving a person’s livelihood.”

Tenderloin Housing Clinic is leasing the hotel from its owner, and after Benioff’s five-year donation to pay that lease runs out, either San Francisco’s budget will pick up the cost or a new donation will be found, the mayor said.

“This hotel sounds like heaven,” she said.

The restored 1908-vintage building is beautiful, with big windows, she noted, and unlike many other residential hotels, “people will have their own bathrooms, and that’s amazing.”

“Ultimately, Marc and I care about the same thing — trying to house as many people as possible who are struggling with homelessness,” she said. “It requires a real partnership to face this challenge, and I want to focus on solutions that stick. We have more coming.”

The Bristol has been closed for nearly four years. Before that it was known for decades as a beacon for drug dealers and other down-and-outers, including the infamous “Night Stalker” serial killer Richard Ramirez in the 1980s. Owner Bill Thakor bought the building in 1998, and after struggling with its sketchy nature he shut it down and has poured $3.5 million since then into fixing it up.

“I’m excited,” said Thakor. “It was totally rundown, and we put in all new plumbing, a new elevator, totally upgraded the whole place.”

Thakor and his family made headlines in 2014 when they were sued by the city for running substandard housing in similar rundown residential hotels and paid a $1 million settlement.

Randy Shaw, executive director of the Tenderloin Housing Clinic, which will operate the Bristol, said he believes the landlord has changed.

“The Bristol was very rundown for a long time, but it is now of real elite quality,” Shaw said. “Bill could have made a lot more money renting it to techies or others at full market price, but he’s doing the right thing here.”

Kevin Fagan is a San Francisco Chronicle staff writer. Email: kfagan@sfchronicle.com