CNN said on Friday that it had cut ties with Reza Aslan, an Iranian-American scholar who was the host of the network’s weekly show “Believer,” after Mr. Aslan assailed President Trump in a series of vulgar messages on Twitter after the terrorist attack at London Bridge last weekend.

Mr. Aslan, whose program covered global religion and began this year, apologized after his tweets on Saturday, in which he described the president as “an embarrassment to humankind” and compared him, using profanity, to a piece of excrement.

His remarks came as Mr. Trump, in messages posted on Twitter minutes after the attack, criticized London’s mayor, Sadiq Khan, and argued that the episode justified the president’s proposal to restrict travel to the United States by people from several predominantly Muslim countries.

“CNN has decided to not move forward with production on the acquired series ‘Believer with Reza Aslan,’” a spokeswoman for the network said in a statement. “We wish Reza and his production team all the best.”