President Trump will venture into hostile territory Saturday night at the annual Gridiron dinner, mingling with members of the mainstream media he loves to lash out against.

The white-tie gala is one of the city's longest-running traditions, and the kind of establishment event that Mr. Trump has so far shunned. But what is supposed to be a lighthearted bread-breaking between the president and press risks becoming a flashpoint if Trump, who has labeled reporters "fake news" and the "enemy of the American people," proves unable to poke fun at himself or take a lashing from the press.

"I think he is in a potentially strange spot where he either attacks the press in a way that works really well at a rally but just gets crickets in that room, or he has spent the past two years calling reporters 'fake news' and then suddenly admits it's just the act," said David Litt, a former speechwriter for President Barack Obama who helped write many of Obama's comedy speeches.

Get Breaking News Delivered to Your Inbox

The dinner is an unusual tradition, with costumed reporters performing song parodies before politicians from both parties speak. The Gridiron's motto — "singe, don't burn" — suggests speakers should feel free to poke and prod, but gingerly. Every president since Grover Cleveland has been subjected at least once.

Mr. Trump skipped the event last year, choosing to send Vice President Mike Pence in his stead. He also passed up the glitzier White House Correspondents Dinner. The White House has yet to announce whether Mr. Trump will attend the latter this year, and his reception this weekend could serve as a test. Last year, Mr. Trump hosted a campaign-style rally in lieu of attending the dinner.

The president's disliking of the press has long been on display, since the early days of the campaign. Mr. Trump, through the Republican National Committee, even announced fake news awards in January.

Despite his reputation for being notoriously thin-skinned, Mr. Trump has subjected himself to comedic takedowns in the past.

He was roasted at New York City's Friar's Club in 2004 where comedians, including Regis Philbin, skewered Mr. Trump for his sexual escapades and business failures in profanity-laced remarks. Video of the event shows Mr. Trump laughing heartily and delivering a rebuttal that was classic Trump.

In addition to thanking his wife and mocking Philbin's height, Mr. Trump bragged about his success in developing Atlantic City casinos and claimed he'd drawn the "biggest crowd they've ever had."

Seven years later, Trump agreed to be pilloried at a 2011 Comedy Central roast that included Snoop Dogg, Seth MacFarlane and Mike "The Situation" Sorrentino. He scowled through most of the event, said Ray James, a writer and producer who served as lead writer.

James said that Mr. Trump was difficult to work with, handcuffing writers, constantly asking whether things were funny and changing jokes to inflate his wealth.

"He didn't get it, he didn't think the jokes were funny," said James, adding that Mr. Trump also made clear to writers that certain topics were off-limits.

"Donald Trump's rule was, 'Don't say I have less money than I say I do,'" roaster Anthony Jeselnik told Joan Rivers in 2013. "He was like, 'Make fun of my kids, do whatever you want. Just don't say I don't have that much money.'"

The closest Mr. Trump has come in recent years to the Gridiron dynamic was New York's white-tie Al Smith dinner during the 2016 campaign, which also was attended by Trump's rival, Hillary Clinton. Trump began innocently enough, joking that Senate Minority Leader Chuck Schumer used to love him when he was a Democrat and poking fun at a plagiarism incident involving his wife.

But Mr. Trump's remarks quickly devolved into bitterness and insults, with the soon-to-be-president earning boos as he pointedly accused Clinton of corruption and hating Catholics.

Jeff Nussbaum, a partner at the speechwriting firm West Wing Writers who has worked with numerous politicians to craft speeches for the event, said Trump's "insult comic" style isn't one that's typically been well-received at these kinds of gatherings.

"Humor is an incredibly powerful weapon. But to wield it on others, you need to demonstrate that you can turn it on yourself first. And that's something President Trump has never demonstrated," said Nussbaum. He said humor requires a degree of self-awareness — understanding what might be funny about yourself to others — as well as a shared fact base with the audience.

Mr. Trump showed a rare moment of self-deprecating humor at the Conservative Political Action Conference (CPAC) last week, when he pointed out a troubled bald spot on his head, much to many people's shock.

United States President Donald J. Trump adjusts his hair as he speaks at the Conservative Political Action Conference (CPAC) at the Gaylord National Resort and Convention Center in National Harbor, Maryland on Friday, February 23, 2018. Credit: Ron Sachs / CNP - NO WIRE SERVICE - Photo by: Ron Sachs/picture-alliance/dpa/AP Images Ron Sachs

Robert Lehrman, a former speechwriter for Al Gore and professor at American University who has written about the use of comedy in politics, pointed to Sarah Palin's 2009 self-deprecating speech at the Gridiron, which included a joke about being able to see the Russian Embassy from her hotel room, as a potential model for Mr. Trump.

And he warned of the potential ramifications of a joke gone bad. In a Washington Press Club Foundation dinner in 2004, then-New Jersey Sen. Jon Corzine compared sharing a media market with Schumer to "sharing a banana with a monkey . . . take a little bite of it and he will throw his own feces at you." The joke infuriated Schumer, souring their relationship.

"There are consequences that Chris Rock doesn't have," Lehrman said.