It’s the moment Stephen Colbert has been waiting for.

CBS’s “Late Show” host has spent months eviscerating President Trump on television, clearly trying to provoke a reaction.

It didn’t work. Until Thursday.

“You see a no-talent guy like Colbert. There’s nothing funny about what he says. And what he says is filthy,” Trump told Time magazine. “And you have kids watching. And it only builds up my base. It only helps me, people like him.”

Trump also took credit for Colbert’s newly improved ratings: “The guy was dying. By the way, they were going to take him off television. Then he started attacking me and he started doing better. But his show was dying. I’ve done his show. … But when I did his show, which by the way was very highly rated. It was high — highest rating. The highest rating he’s ever had.”

President Trump said he fired former FBI director James Comey because the organization was in "virtual turmoil" during an exclusive interview with NBC News on May 11. (NBC News)

In his monologue Thursday night, Colbert addressed Trump’s comments, point by point. After reading the entire passage to his studio audience, Colbert started off solemnly: “The president of the United States has personally come after me and my show,” he said. “And there’s only one thing to say.”

Colbert then broke into a gleeful, maniacal cackle. “Yayyyy!” he exclaimed, rubbing his hands together, looking genuinely grateful as the audience chanted “Steph-en! Steph-en! Steph-en!”

“Mr. Trump, Mr. Trump,” Colbert said, composing himself as the crowd noise died down. “There’s a lot you don’t understand. But I never thought one of those things would be show business. Don’t you know I’ve been trying for a year to get you to say my name?! And you were very restrained. Admirably restrained.”

“But now you did it!” Colbert said triumphantly. “I won.”

The audience burst into applause. Colbert was just getting started.

After making an oral-sex joke about President Trump and Vladimir Putin, there are calls from Trump supporters to fire late-night host Stephen Colbert. On May 3, Colbert acknowledged the haters, but he didn't apologize. (The Washington Post)

“Please, oh please! Don’t make me trend on Twitter again! Don’t throw me in that hashtag briarpatch,” he said. “But you’re not wrong. I will give this to the man, you’re not wrong. I do occasionally use adult language — and I do it in public instead of the privacy of an ‘Access Hollywood’ bus.”

“Ohhhh,” the audience jeered, in reference to Trump’s most infamous quote. Trump’s remark about Colbert’s “filthy” talk, of course, refers to the oral-sex joke that Colbert made last week about Trump and Russian President Vladimir Putin. After a backlash from some viewers that sparked a #FireColbert hashtag, Colbert acknowledged that he could have used less-crude language but refused to apologize. (“I have jokes; he has the launch codes,” he said.)

Back to Colbert’s monologue: “It’s true,” Colbert said of Trump’s ratings claim. “The night you appeared on this show … was very highly rated. In fact, the only episode that got better ratings was the night I had Jeb Bush on.” Indeed, Bush stopped by Colbert’s “Late Show” premiere in September 2015, which scored 6.6 million viewers. A few weeks later, Trump’s appearance earned 4.6 million.

“That’s right. You got beat by low-energy Jeb,” Colbert added. “But don’t worry — you won the ratings college.”

The crowd really appreciated that dig. “And making jokes about you has been good ratings. It’s almost as if the majority of Americans didn’t want you to be president!” Colbert said. “But you know who has got really bad ratings these days? You do. Really terrible approval numbers. I hear they’re thinking about switching your time slot with Mike Pence.”

“But since all of my success is clearly based on talking about you, if you really want to take me down, there’s an obvious way,” Colbert continued. “Resign.”

Colbert paused as the audience burst into applause again. “If you did that, what would I talk about then? Except your resignation, cause that’d be fun,” he said. “And here’s the thing: A president going after someone telling jokes is unprecedented. That would be like Richard Nixon going after Alfred E. Neuman.”

“And if I may, Mr. President,” Colbert concluded, “I’d like to quote that great man.” He paused to cover his front tooth, Alfred E. Neuman-style, and grinned directly at the camera. “What, me worry?”

Read more:

Trump objects to Stephen Colbert’s ‘filthy’ talk because ‘you have kids watching’

‘Words fail me’: Late-night hosts skewer Trump’s news conference

Jon Stewart joins Stephen Colbert to mock the media’s ‘breakup’ with Trump

‘Daily Show’ vets Stephen Colbert and Jon Stewart reunite to discuss Comey, Trump jokes and Bill O’Reilly

Is your favorite TV show canceled? A guide to what’s renewed and what’s in jeopardy.

‘Never fjorget’: Colbert mocks Trump’s Sweden flub, honors ‘all the people who did not suffer’