Fox has renewed “The Last Man on Earth” and “Gotham” for the 2017-2018 season, Variety has learned. Both shows will head into their fourth seasons.

Will Forte’s “Last Man on Earth” is a half-hour comedy about the life and adventures of the last man on earth, played by the “Saturday Night Live” alum. Forte created the series and serves as executive producer, star and writer.

Along with Forte, other executive producers are Christopher Miller, Phil Lord, Seth Cohen, Andrew Bobrow and Erik Durbin. The cast is rounded out by Kristen Schaal, January Jones, Mel Rodriguez, Mary Steenburgen and Cleopatra Coleman. 20th Century Fox Television produces.

This past weekend, before he got the news of the Season 4 renewal, Forte spoke with Variety at a photoshoot and joked that he used to think “SNL” would be his hardest job ever, until he moved onto “Last Man” where he juggles so many roles.

Fox has also renewed “Gotham,” which is based on the DC characters. Revealing an entirely new chapter that has never been told, the crime procedural follows one cop, destined for greatness, as he navigates a dangerously corrupt city teetering between good and evil, and chronicles the birth of one of the most popular super heroes of our time.

Ben McKenzie stars with Donal Logue, David Mazouz, Morena Baccarin, Sean Pertwee, Robin Lord Taylor, Erin Richards, Camren Bicondova, Cory Michael Smith, Jessica Lucas, Chris Chalk, Drew Powell, Maggie Geha, Benedict Samuel and Michael Chiklis. The show hails from Bruno Heller and executive producers Danny Cannon and John Stephens. Warner Bros. Television is the studio.

Looking ahead at the 2017-2018 season, Fox has cancelled “Pitch,” “Rosewood” and “Sleepy Hollow.”