Kent Alterman, Comedy Central’s president, said he informed Mr. Wilmore of the news late last week. The move, Mr. Alterman said in an interview, was made for a simple reason: The show “hasn’t resonated.”

“Even though we’ve given it a year and a half, we’ve been hoping against hope that it would start to click with our audience, but it hasn’t happened, and we haven’t seen evidence of it happening,” Mr. Alterman said.

The awkward timing of the cancellation, just 12 weeks before the presidential election, ultimately came down to a contract, Mr. Alterman said. Mr. Wilmore’s deal, along with those of several of the show’s other staff members, was set to expire in a few weeks and the network had to decide now whether to renew or cancel.

For the time being, Comedy Central’s 12 a.m. show, “@midnight,” will replace “The Nightly Show” at 11:30 p.m. “The Daily Show” with Trevor Noah remains at 11 p.m. Mr. Alterman said he hoped to name a full-time replacement for “The Nightly Show” sometime next year.

The cancellation makes Mr. Wilmore, 54, an early casualty of a television late-night comedy slate that has been vastly reordered over the last two years. With the retirement of David Letterman, Jay Leno and Mr. Stewart, and Mr. Colbert’s move to CBS, a series of new hosts have stepped into the spotlight, including James Corden, Samantha Bee, John Oliver and Mr. Noah. Jimmy Fallon, the host of “The Tonight Show,” has most formidably filled the power vacuum left by his predecessors, earning the highest ratings of any late-night show.