LOS ANGELES — Television host and comedian Stephen Colbert has signed a deal to become the next host of the CBS “Late Show,” replacing David Letterman when he retires next year, the network said Thursday.

Colbert, 49, currently star of “The Colbert Report,” a weeknight show on the Comedy Central cable channel in which he parodies the role of a conservative TV commentator, signed a five-year agreement with CBS, the network said.

“Stephen Colbert is one of the most inventive and respected forces on television,” Leslie Moonves, CBS president and chief executive officer, said in a statement announcing the deal.

“David Letterman’s legacy and accomplishments are an incredible source of pride for all of us here, and today’s announcement speaks to our commitment of upholding what he established for CBS in late night.”

The location of the show will be determined at a later date, the network said, leaving open the possibility that the “Late Show” may relocate from New York. Colbert tapes “The Colbert Report” in Manhattan as well.

Letterman, 66, said last week on his show that he was retiring from late-night television sometime next year when his CBS contract expires. Letterman began the “Late Show” on CBS in 1993 after 11 years as the host of NBC’s “Late Night” program.

“Simply being a guest on David Letterman’s show has been a highlight of my career,” Colbert said in a statement. “I never dreamed that I would follow in his footsteps, though everyone in late night follows Dave’s lead.”