NEW YORK — Stephen Colbert has gleefully responded to insults hurled his way by the president, cheering the fact that he finally got Trump to say his name.

Trump told Time magazine that Colbert was a “no-talent guy” and “there’s nothing funny about what he says.” The president also took credit for Colbert’s improved ratings, saying he didn’t start doing better until he began attacking Trump.

Colbert responded on his CBS “Late Show” on Thursday. As if talking to Trump, Colbert said that “don’t you know I’ve been trying for a year to get you to say my name?” He added: “I won.”

“Making jokes about you has been good for ratings,” Colbert said. “It’s almost as if a majority of Americans didn’t want you to be president. But you know who’s got really bad ratings these days? You do.”

Colbert eclipsed NBC’s Jimmy Fallon to make CBS’ “Late Show” the most-watched program in late night after Trump’s inauguration, and he hasn’t looked back since.

Trump said Colbert’s show was “dying” and was going to be taken off the air until the relentless attacks began. CBS did have concerns about the “Late Show” and named a new executive who has led a turnaround. The president also said that when he was on Colbert’s show, “it was the highest ratings he ever had.”

Trump’s visit to the show on Sept. 22, 2015, was seen by 4.6 million people – the second biggest audience Colbert has had on the “Late Show.”