UC Hastings College of the Law is embarking on an aggressive expansion of its Tenderloin campus, a five-year project that will include not only new housing and academic buildings, but also a three-level YMCA the school hopes will help strengthen connections with the hardscrabble neighborhood it has long called home.

Next month, Hastings plans to start construction on the first piece of a long-planned campus makeover, a $58 million, 55,000-square-foot academic building to be erected on a vacant lot the school owns at 333 Golden Gate Ave., between Larkin and Hyde streets.

That new building will set three projects in motion. Once the new academic building opens in late 2019, Hastings will knock down an existing 1953 structure known as Snodgrass Hall and replace it with a 14-story, 592-unit residential tower that will be split between students from the law school and from UCSF. In addition, Hastings will renovate an existing residential structure at 100 McAllister St.

The goal is to create an “academic village” feel that the urban Hastings has been lacking, said David Seward, the school’s chief financial officer.

“We are trying to get some of that college commons feel,” said Seward, who is overseeing the campus expansion.

Noah Berger/Special to The Chronicle

But while Hastings is hoping the new classroom space and housing units will help attract students and faculty, it is the 45,000-square-foot YMCA at the base of the residential tower that is likely to cause the most excitement for those who live or work in the Tenderloin.

Until 2009, the Y had a facility at 220 Golden Gate Ave., a building that was sold to the Tenderloin Neighborhood Development Corp. to be converted to supportive housing.

YMCA of San Francisco President Chuck Collins said opening at 198 McAllister will represent a homecoming of sorts. The building at 220 Golden Gate was the oldest YMCA in the city and was sold because the organization couldn’t afford the needed seismic retrofit.

“It resets our longest-term and deepest commitment in this city, which is to the Tenderloin,” Collins said. “It opens an opportunity to show what the Y can bring in a holistic way to a larger vision around a academic village.

“It will be more than just a gym, a swimming pool and exercise space,” Collins said. “We are interested in social justice, in youth development, in holistic and chronic disease prevention. We see a tremendous opportunity for civic engagement.”

The start of the project comes as colleges and universities are struggling with a lack of housing, which hurts their ability to recruit teachers and students. San Francisco has a student housing shortage of about 60,000 units, according to a survey by the Housing Action Coalition.

San Francisco has about 30 colleges and universities with 120,000 students. The coalition estimates that about 50,000 of those students are in the private housing market, largely renting rooms via Craigslist.

UCSF students will occupy 40 to 50 percent of the apartments. The medical school needs about 2,000 units to meet demand from students and trainees, according to Clare Hansen-Shinnerl, associate vice chancellor at UCSF. Combined with 595 units UCSF has under construction in Dogpatch, the joint project with Hastings will start to put a dent in the housing deficit, she said. “We still have a ways to go, but it’s a start,” she said.

The units will be mostly studios. “These are graduate students. They really want their privacy,” Hansen-Shinnerl said. “They are not kids anymore. Small is OK, as long as it’s private.”

Hastings and UCSF will be looking for a private developer to oversee the new housing project as well as the rehab of 100 McAllister. “The challenge is how one goes about developing student housing at rent levels that are affordable,” Seward said.

David Faigman, chancellor and dean at Hastings, said having law and medical students living in proximity would help reinforce existing collaborations between the two institutions. The two campuses currently collaborate on the Consortium on Law, Science & Health Policy and also offer a joint online course in health-policy law.

Jeff Buckley, who advises Mayor Mark Farrell on housing policy, said it’s up to the institutions to create housing for their students, as student housing doesn’t generally pencil out economically for private developers.

“This is a really important step for Hastings in terms of remaining competitive, but also for the Tenderloin,” he said. “Students contribute a lot to the surrounding economy.”