At the Nob Hill Theatre, customers had two choices.

For $15, they could take the stairs to the left and cruise a dark basement of semiprivate rooms and video booths that played 100 adult films. Or for an extra $5, they could have the basement and a seat in the theater to the right, explained Shelley Steward, who worked the front desk at the theater for 13 years. There, every 30 minutes, a new performer would take the stage, remove his clothes and make his way out into the audience.

In many ways, Nob Hill Theatre, which closed Sunday, Aug. 19, after 50 years in business, was a relic, a holdover from a time when San Francisco was called the “Smut Capital of America,” when gay men had few safe places to meet, pornography was hard to come by and phones didn’t have touch-screens or dating apps. The theater’s slogan, “Touch Our Junk,” wasn’t an empty promise.

But it’s also true that up until its very last day, Nob Hill Theatre was a living and vital space, one that people from around the world would come to visit, and one that even people who had never visited before told Steward they’d miss. Sometimes there’s a comfort in simply knowing something exists.

“This is another nail in the coffin of gay San Francisco,” Steward said, just days before the closure. “It’s the end of an era.”

But before the Nob Hill Theatre closed for good, there was a party.

The venue was sold out Friday, Aug. 17, and the hallways were choking with people. Dancers worked the room, sitting on customers’ laps, whispering into their ears. Men eyed the theater’s Hall of Fame, a long walkway covered in framed and signed posters (most of them X-rated) of the performers who had passed through Nob Hill.

The adult film company NakedSword was shooting a live sex show there for a cinematic tribute to the space. The demand for a ticket was so high that the owners, Gary Luce and Larry Hoover, had resorted to selling some extra standing-room-only tickets.

Everybody had come for the show, of course, but when they talked about the theater — a place where one could buy Tic Tacs, “tape head cleaner” and $1 packets of lubricant at the front desk — they talked about more than sex. They talked about sexual liberation, about artistic freedom, about history.

Michaiel Bovenes was there. Of course, he was. He’d been a regular at Nob Hill for 12 years. He moved to San Francisco in 2006, but his first visit to the theater was eight years before that. He knows what this place means.

“The whole thing about shame and sexuality has totally shifted, and I think the Nob Hill Theatre was on the cutting edge of helping people realize you could be sexual and be normal,” he said. “They’ve done a lot to release some of the shame around it.”

There were a couple warm-up acts before the main event started Friday. First was the fashion show, actors with stage names like Max Adonis and Brandon Wilde walked down the center aisle, showing off flowing silk robes. When they got to the stage, they’d drop them.

Next up was Woody Fox, a headliner in from Las Vegas. He took the stage in a leather bodysuit, one with holes punched into it every other inch. When his song started, he unzipped the front of the suit, just enough to show off his chest, and then jumped from the stage and grabbed two hanging ropes. He spun and posed in midair for a few minutes. Cell phones were up everywhere, people were on tiptoes trying to get a better view.

Fox is joining Cirque du Soleil in a couple of months, he said later in the hallway, as the live show began. But he wanted to fly in to perform and pay his respects to the place where he’d made his first film. “For me it’s where it all began,” he said.

Before the NakedSword shoot got started, mr. Pam, the film’s director, got on the mike. She asked everybody to grab somebody else’s hand so she could lead the audience through a prayer: “Dear Porn God, thank you for bringing us all here together today to the legendary Nob Hill Theatre.”

The building that was home to the Nob Hill Theatre is a squat, beige little structure. It has no windows. The space has been around much longer than the theater, of course. It was a nightclub in the 1940s and a jazz club in the ’50s. (Luce and Hoover have a photo of Louis Armstrong warming up in the backroom.) It wasn’t until 1968 when Shan Sayles reopened the space as Nob Hill Theatre, a name he’d bought from the Fairmont Hotel when its theater closed.

For at least a couple years, Sayles played European art films at the theater. But business was slow, so he changed course.

“They stopped showing the B movies and started showing gay porn,” Hoover said. “According to Shan, the line was around the corner overnight.”

At the time, decency laws were all the rage, but San Francisco was quickly becoming the epicenter of the sexual revolution. Sayles, who died in 2016, rode the wave, adding dancers and headlining acts to the schedule, turning the space into a one-of-kind, all-in-one stop for gay men.

He ran the business until he couldn’t, handing its management over to another company for some time before persuading Luce and Hoover to take it off his hands in 2010. If they didn’t, Sayles told them the place would close. They didn’t want that.

Hoover and Luce are charming and unassuming. They look a bit alike, both with their hair cut short, black-frame glasses. Mr. Pam calls them her “gay dads” — and that is very much the energy they give off. They don’t seem like a couple who would own a gay arcade and a theater that features live sex shows. But that’s the charm of Nob Hill; nothing about it is exactly what one would expect.

They love the theater — the customers, the employees, the community that has formed around it — but eight years is a long time to run a business, even one that makes a good profit, they said. It’s time to move on, time to get a place where they don’t have to walk down a dark hallway, right past booth No. 10, to get to the door of a basement apartment.

When they put the building and the business up for sale last year, they hoped somebody would buy the whole package, keep it zoned for adult use. But in nine months, not a single person came forward with an offer to do that.

The real estate agent who sold the property for more than $3 million said the new owners won’t disclose what they are converting the theater into. Whatever it is, though, it won’t be the Nob Hill Theatre.

Luce and Hoover are planning an estate sale for Labor Day weekend. Most everything will go — the theater’s chairs, the signed posters, the disco ball. But they have set plenty aside for the GLBT Historical Society. “At least the history part will be recorded,” Luce said.

In going through it all, Luce came across a copy of the 1974 edition of “Bob Damron’s Address Book,” a state-by-state and city-by-city guide of gay-friendly bars and hotels. It’s a small book, 130 pages and the size of a palm; the green cover is faded. Much like the theater, it belongs to a different time.

Luce opens it up and flips to San Francisco.

“Just pages and pages and pages of bathhouses and bars that don’t exist anymore. Just pages,” Luce said. “But this place thrived.”

Ryan Kost is a San Francisco Chronicle staff writer. Email: rkost@sfchronicle.com Twitter: @RyanKost