Mr. Trump and his associates have long been critical of CNN. On Tuesday, the president’s re-election committee issued a statement criticizing CNN for what the committee described as censorship because the news network did not air an advertisement that was released on Sunday.

The ad briefly shows faces of television journalists, including several from CNN, with the words “attacking our president,” and a voice-over at the end says “the president’s enemies” as their faces reappear.

A network spokeswoman said CNN would have accepted the ad if the reporters and anchors had been removed.

“Anchors and reporters don’t have ‘enemies,’ as the ad states, but they do hold those in power accountable across the political spectrum and aggressively challenge false and misleading statements and investigate wrongdoing,” Barbara Levin, the spokeswoman, said.

In July, Mr. Trump posted a video on his Twitter account portraying him wrestling and punching a figure whose head had been replaced by the CNN logo. The video appeared to be an edited clip from years ago when Mr. Trump was part of a professional wrestling event.

In the speech on Long Island a few weeks ago, the president told a group of law enforcement officers assembled for the event that he preferred they not be too “nice” with criminal suspects, a remark that drew widespread condemnation.

Late Monday, Mr. Trump also shared a post from the account of a pro-Trump conspiracy theorist suggesting that the news media is ignoring violence in Chicago. The account owner, Jack Posobiec, is known for promoting false narratives such as the “Pizzagate” hoax and a conspiracy theory about the murder of a Democratic aide.