Jimmy Kimmel came very close to quitting his late-night hosting gig after executives at ABC asked him to lay off jokes about former President Donald Trump.

The host made his "Jimmy Kimmel Live!" debut in 2003 on ABC. However, after Trump announced his plans to enter politics, Kimmel's late-night legacy almost came to an end.

During an episode of the "Naked Lunch" podcast, Kimmel revealed network executives approached him about how his decision to mock Trump was affecting ratings.

"There was one time, right around the beginning of this whole Trump thing... maybe not quite [eight years ago]," Kimmel said.

"I said, listen, I get it, you're right. I have lost half of my fanbase, maybe more. Ten years ago, among Republicans, I was the most popular talk show. At least according to the research they did."

While Kimmel understood ABC's concerns, he refused to censor his material about Trump. "I get it if [blocking Trump jokes is] what they want to do," Kimmel explained.

"I said, 'If that's what you want to do, I don't begrudge you for it, but I'm not going to do that. If you want someone else to host the show, that's fine with me. I'm just not going to do it like that.'"

Kimmel remained firm about his decision to continue to cover Trump, and ABC backed down. "I was serious. I couldn't live with myself [if I didn't grill Trump]," he explained.

Throughout Trump's presidency, he and Kimmel remained at odds. The pair would often trade jabs on Twitter until Trump's ban from the social media platform.

On one occasion, Trump appeared to shade Kimmel's 2018 Oscars hosting gig, which averaged 26.5 million viewers and was down 19 percent compared to the previous year.

"Lowest rated Oscars in HISTORY," Trump tweeted at the time. "Problem is, we don't have Stars anymore — except your President (just kidding, of course)!"

Kimmel replied by criticizing Trump's ratings, "Thanks, lowest-rated President in history."

Despite his feud with Trump, Kimmel's relationship with ABC appears to be on solid ground. Earlier this year, ABC renewed Kimmel's hosting contract for an additional three years. The deal was scheduled to expire in 2023.

Late night talk show host Jimmy Kimmel has the tough task of hosting the Emmys, the first major pandemic-era awards show
Late night talk show host Jimmy Kimmel has the tough task of hosting the Emmys, the first major pandemic-era awards show AFP / Chris Delmas