Just months before El Rio’s 41st birthday party, “Your Dive” secretly faced its downfall. But the Mission Economic Development Agency intervened to buy the building, and the dirt-cheap Tecates will keep coming.

You don’t need us to tell you that the queer nightlife scene has teaken a beating in recent years, going back to the tragic loss of the Lexington Club, Truck crashing in 2015, and the city’s oldest gay bar Gangway biting the dust early last year. But the loss of Mission District standby El Rio would have been one of the worst gut punches of them all, and apparently, that almost happened over the course of the last couple months. But $2 Tecates (on Mondays) and free oysters (on Fridays) will continue to flow through El Rio, as the Chronicle reports that El Rio nearly shut down but has been saved.

“A few months ago, we had to face the possibility that El Rio wouldn’t exist anymore,” owner Dawn Huston told the Chronicle. “I can’t express enough just how immensely grateful we are.”

The reason for their near-closure was simple and familiar — the building, along with its eight upstairs housing units, was put up for sale, with no assurance the new owners would continue leasing to a bar that serves $2 beers when they could bring in something more upscale.

As the Bay Area Reporter explains, the details of its rescue are far more complicated; San Francisco runs a “small sites” program, which provides loans through the San Francisco Housing Accelerator Fund. That fund provided an $8.6 million loan to the Mission Economic Development Agency (MEDA), who are the new owners, and will also provide some seismic retrofitting and renovations to its electrical and infrastructure systems.

“The most historic queer bar in my district is going to be around for decades to come,” Sup. Hillary Ronen told the Chron. “It’s one of my go-to, favorite places in the city. There was no way we or the community was going to let that bar disappear and go the way of so many other beloved businesses.”

The long history (her-story?) of El Rio goes back to 1978, when it opened as a Leather Brazilian Gay Bar owned by Malcolm Thornley and Robert Nett. Those two sold the place to Huston in 1997, and it has since long served as home of the Trans March afterparty, for years the host of Hard French and now Daytime Realness and Swagger Like Us.

Image: El Rio via Facebook

And to the El Rio 41st Birthday and Dolly Parton Hoot is still on for Saturday afternoon at 2 p.m.

Related: The 13 Best Patio and Rooftop Bars in San Francisco [SFist]

Image: Rob T. via Yelp