Just hours after Shane Gillis got the career break of any comedian’s dreams Thursday — a job on “Saturday Night Live” — his name began trending for all the wrong reasons.

Freelance comedy journalist Seth Simons called attention on Twitter to a podcast Gillis recorded last year. The episode of “Matt and Shane’s Secret Podcast” featured Gillis and co-host Matt McCusker using slurs against Chinese people, mocking their accents and making racist references to Chinatown.

Soon, social media was brimming with examples of Gillis’s questionable humor — material degrading to women, minorities, gays and transgender people.

The backlash was swift, even as it coincided with praise for another of SNL’s three new hires, Bowen Yang, a Chinese American comedian and one of the very few performers of Asian heritage to appear on screen in the show’s nearly 45-year history.

“It took 45 years for @SNL to get an East Asian cast member and in that same year he’ll be joined by someone who would have no problem calling him” by a slur, actor Daniel Dae Kim commented on Twitter. “Gotta be a joke in there somewhere.”

SNL has not yet commented on the controversy. Gillis posted an apology on Twitter late Thursday. “I’m a comedian who pushes boundaries. I sometimes miss,” he wrote. “If you go through my 10 years of comedy, most of it bad, you’re going to find a lot of bad misses. I’m happy to apologize to anyone who’s actually offended by anything I’ve said.”

The resulting backlash has placed the Mechanicsburg, Pa., native at the center of an ongoing debate about whether comedians should be held accountable for offensive material, onstage or off. It’s an evolving litmus test that has ensnared even veteran comics such as Dave Chappelle, whose repeated jokes about transgender women have exhausted some of his most loyal fans. The Gillis controversy has also led to discussions about “cancel culture,” a term used to describe the rapid-fire frequency with which someone’s past behavior can trigger social-media scorn and real-life fallout — and one that’s being increasingly applied in comedy.

Fans of Gillis have defended his “jokes,” though a good deal of the material in question was presented not in a stand-up setting but on his podcast — blurring the line between comedy and conversation.

The uproar evokes the controversy that unfolded in 2016 after an activist uncovered old racist tweets from Melissa Villaseñor, a Mexican American comedian whose addition to the show that year had been widely celebrated. But the tweets from Villaseñor, who will begin her third season when SNL returns Sept. 28, were from several years earlier. (Trevor Noah and Kevin Hart have both faced criticism over years-old tweets, in Hart’s case leading to the loss of a high-profile gig hosting the Oscars.)

But some of the questionable humor that circulated Thursday was recorded as recently as last year. “i can’t believe shane gillis’s present is resurfacing,” stand-up comedian Myq Kaplan tweeted Friday. A deeper dive into his podcast archive reveals even more recent uses of homophobic and racist language. In a Sept. 2 episode, Gillis’s co-host uses a homophobic slur to refer to Civil War soldiers. In another episode, dated July 30, the pair discuss privilege and political correctness.

At one point, McCusker talks about a white restaurant owner who faced protests after firing a black employee. McCusker notes the protesters “are mostly white people.” “Of course,” Gillis chimes in. “And ladies with, like, dreads that went to an Ivy League school. That’s just what I see — usually a white dad is involved.”

Gillis’s tamer-by-comparison stand-up routine generally riffs on his small-town upbringing — and his culture shock after moving to cities including Philadelphia, where he was based for several years, and New York, where he currently lives. “I took Skoal out of my mouth to come up here, and I didn’t vote for Donald Trump,” he jokes in a set posted recently to Comedy Central’s YouTube page. “That makes me like the Nelson Mandela of Central Pennsylvania.”

That perspective was a draw for Greg Godbout, who booked him for a headlining gig at Washington’s DC Drafthouse last month.

Godbout, president of the comedy club, had not listened to the podcasts that surfaced Thursday. But he said he booked Gillis in part because of videos he had seen online — including stand-up routines and a viral sketch about a MAGA hat-wearing firefighter who saves a family only to be grilled by a reporter in regard to his political leanings.

“Great comics tell stories from their perspective,” said Godbout. “That’s what makes it fun to have such a variety.” He declined to share details about the turnout at Gillis’s show but said he was “very pleased with the crowd.”

“I think he’s genuinely very funny,” said Godbout, while acknowledging that “funny is an opinion.”

And he would book Gillis again. “True embracing of diversity means lots of voices,” he said, noting that the venue employs numerous bookers to ensure different perspectives. “I wouldn’t be able to book many comedians if I was worried about controversy,” he added.

But at least one venue pointedly distanced itself from Gillis amid the fallout. The Good Good Comedy Theatre, in Philadelphia’s Chinatown district, tweeted Thursday that its staffers “were very quickly disgusted by Shane Gillis’ overt racism, sexism, homophobia and transphobia — expressed both on and off stage — upon working with him years ago.”

“We’ve deliberately chosen not to work with him” since then, they added.

After Gillis’s DC Drafthouse gig, he appeared on Counter Currents, a podcast that features interviews with the venue’s headliners but is produced independently.

Toward the end of the occasionally raucous conversation, the topic turns to “cancel culture.”

“I gotta stop going on podcasts,” Gillis concludes, as the show’s co-hosts note that his “digital footprint” might be “too high” and that “things do come back to haunt you.”

“You know, hopefully they don’t,” he replies. “Hopefully in the next couple of years, it stops.”

Andrew Ba Tran and Sonia Rao contributed to this report.