MONTREAL — For generations, parishioners whispered their sins in the dark wooden confessional booths of Notre-Dame-du-Perpétuel-Secours, an imposing Roman Catholic church in Montreal.

But on a recent day, the edgy Quebec comedian Sugar Sammy was being filmed inside one of the booths, the latest intimate celebrity confessional on the talk show “Y’a du monde à messe,” or “The Church Is Packed.”

“I made a sex tape in order to be famous, because I thought it was the path to glory,” Sammy said with mock seriousness, as the camera zoomed in on his face, seen from behind a grill. “It didn’t work because no one watched it,” he continued. “I was the only person on the tape.”

A large audience gathered in the church roared with laughter.

The once-hallowed space, now illuminated with a giant pink chandelier, has been reinvented as the Théâtre Paradoxe at a cost of nearly $3 million in renovations. It is now host to, among other events, Led Zeppelin cover bands, Zumba lessons and fetish parties, as well as the talk show that Sammy appeared on.

And it is one of dozens of churches across Quebec that have been transformed — into university reading rooms, luxury condominiums, cheese emporiums and upmarket fitness centers.

At another event at the church, devoted to freewheeling dance, dozens of barefoot amateur dancers filled the space and undulated in a trancelike state in front of its former altar amid drums and chanting. Two men in tank tops clasped hands and twirled each other. A woman in blue juggled three white balls, putting one on her head.

Several wooden pews were recast to build a handsome bar for alcohol-fueled banquets. The former sacristy where priests prepared for Communion is now a dressing room fit for a diva.

While the church has welcomed a “Crucifix Halloween” party featuring barely dressed, leather-clad dancers gyrating in front of a lit-up cross, its director, Gérald St-Georges, a Roman Catholic, stressed that its main function was still sacred rather than profane. It teaches former addicts, juvenile delinquents and high-school dropouts technical theater skills so that they can enter the job market.

“I don’t feel any taboo in transforming a church into a theater, as we are remaining true to the church’s mission of serving the community,” St-Georges said.

The radical makeovers of Quebec churches reflect the drastic decline of the Catholic Church in a majority-Catholic Canadian province, where 95 percent of the population went to Mass in the 1950s but only 5 percent do so today.

The sharp drop in church attendance, coupled with spiraling maintenance costs, has made heritage groups, architects and the church itself think creatively to conserve historic buildings at risk of being shutteredor demolished.

As of April, 547 churches in Quebec had been closed, sold or transformed, according to the Québec Religious Heritage Council.

Throughout the centuries in Quebec, the church provided health and education, and dominated life. Towering old crosses still dot hills across the province, monuments to this past.

But the church also opposed divorce, censored books and bullied women to reproduce, and in the 1960s, a generation rose in revolt, a period known as “The Quiet Revolution.”

St-Georges, 54, of the Théâtre Paradoxe, recalled being told that when his mother was ill and already had nine children, the local priest had insisted that she have a 10th: him. She died shortly thereafter.

“The clergy crossed the line into people’s private lives, so people rebelled,” he said, noting that although he worked in a former church, he no longer attended services.

Gérard Bouchard, an eminent historian and sociologist with the Université du Québec à Chicoutimi, noted that playfully subverting the original function of churches was the result of a deep distrust of religious authority.

“Feminism is very strong here,” he said, “and people remember what the church did to their mothers and grandmothers.”

Officials from Quebec’s Roman Catholic Church said the repurposing of churches was a matter of demographics and economic pragmatism, even as they acknowledged that it was often accompanied by heartbreak.

Christian Lépine, the archbishop of Montreal, noted that once a church had been deconsecrated and passed to private hands, the religious authorities could not control how it was used.

“There is a sadness when a church is shuttered or transformed, but we have to accept reality,” he said.

The Église Saint-Mathias-Apôtre, in a working-class neighborhood of Montreal, once provided spiritual succor to pious factory workers. Today, it has been rebranded Le Chic Resto Pop, serving hearty chicken brochettes and catering to socially disadvantaged residents and bohemian artists, who can buy 60 meals for $20.

Diners are greeted by the decorative tomb that once housed the ashes of a resident priest, though the church’s austere stained-glass windows were removed to let in sunlight and create a more secular space.

After a church has been selected for conversion, any human remains inside are exhumed and moved to a Catholic cemetery. Many architects seek to keep some original details, like crosses, in a nod to the buildings’ religious heritage.

While the church face-lifts have spawned little protest, not everyone is pleased.

After the local church in Sainte-Élizabeth-de-Warwick, a central Quebec town of 400 people, was transformed into an upmarket cheese company a few years ago, its owners decided to keep a small part of the structure as a functioning chapel for the community.

Some residents, however, refuse to attend Sunday Mass in a church where the former nave had been repurposed to store and ripen cheese.

Jean Phillipe Leblanc, 24, said his family had celebrated their baptisms, conformations and marriages there for generations, and, for them, repurposing the church was nothing less than a “sacrilege.”

But Jean Morin, the owner of La Fromagerie du Presbytere — who purchased the church for $1, invested $1.2 million to renovate it and has since won the Canadian Cheese Grand Prix — said the church’s transformation had saved the house of worship for future generations.

Every Friday, the fromagerie hosts dozens of people for cheese tastings, many more than the number who attend Sunday Mass. “Producing my cheese here is my idea of paradise,” Morin said. At the upmarket Saint Jude gym and spa in Montreal’s bourgeois-bohemian Plateau-Mont-Royal neighborhood, members show off their muscles in the church’s former chapel, forsake kneeling in favor of ashtanga yoga poses and luxuriate in an outdoor steamy bath in the shadow of the church’s imposing steeple. The church’s gothic windows look down incongruously on spinning bikes and a weight room.

Olivier Pratte, 31, an advertising copywriter who works out at the gym, noted that while his grandmother was religious, his parents’ and his generation were not.

“My grandmother is happy I spend time in a church,” he said, “even if I’m working my biceps and not my soul.”