WASHINGTON — On a wet night in August, in a bare room in the basement of the Sixth and I synagogue, one of Washington’s oldest, the comedian Joe Mande was preparing backstage for his stand-up set.

Then the heavy rains started to flood the floor. Mr. Mande and his audience were hurried upstairs, to the 800-seat sanctuary under an elaborate 69-foot Moorish-style dome, where hundreds of 20- and 30-something guests crammed into pews. Mr. Mande soon unleashed an expletive-laden set from the pulpit, delivering his usual jokes in front of a painted portion of scripture: “Remember Ye the Law of Moses.”

“It was like an anxiety dream,” said Mr. Mande, who is Jewish. “I was imagining that the manager was going to be like, ‘You have to do your Torah portion.’ I couldn’t believe what was happening.”

The setting might have been unlikely in most houses of worship, but not the Sixth and I Historic Synagogue — now a centerpiece of Jewish life in the capital, where bawdy comedy sets, high-profile music acts, podcast recordings, beer tastings and book talks mix with traditional spiritual programming: Simhat Torah celebrations, regular Sabbath observances, Purim theater and five varieties of High Holy Day services.