John Oliver will be on HBO through the next presidential election.

HBO announced on Tuesday that it had signed its late-night star to a new three-year deal, keeping Mr. Oliver’s weekly Sunday night show “Last Week Tonight” on the air through at least 2020.

The move was a no brainer for the premium cable channel, which needs a variety of popular content to continue enticing people to sign up for its stand-alone app, HBO Now, and retain viewers who pay to watch it on cable. Mr. Oliver’s show won the best variety show Emmy last year, and is a favorite to repeat at the Emmys this Sunday.

Mr. Oliver, a former correspondent for “The Daily Show,” has committed to doing 30 episodes per season. “Last Week Tonight” debuted in 2014.