As upfronts loom, the status of Gotham has finally become clear. Fox has officially given the Batman prequel a fifth season order.

Over the weekend, it was initially reported that, should Fox renew Lethal Weapon, it was highly unlikely it would also renew Gotham. The reason behind this was because Fox doesn't technically own Gotham -- or Lethal Weapon, for that matter -- and was looking to clean up its line-up because of its deal with the National Football League and Major League Football; this meant getting rid of the often-referred-to "bubble" shows that failed to bring in viewers. One thing the Batman prequel had working in its favor at the time was that Lethal Weapon was having trouble securing a new lead with a Monday deadline looming. Unfortunately, since then, the Fox drama has managed to land a replacement for fired actor Clayne Crawford, leading many to worry what would ultimately become of Gotham. Well, fortunately, the series has managed to secure a fifth season pick-up. Unfortunately, however, the show's fifth season will officially be its last on the network.

RELATED: Gotham’s Fate Hinges On … the Lethal Weapon TV Series?!

An earlier report originally suggested the Batman series would be returning for a 13-episode final season in order to achieve syndication. However, according to TV Line, an episode count has yet to be determined. The decision to bring the series back for a final season is somewhat surprising, as the show has been averaging a 0.8 in the all-important 18-49 demo rating and just 2.62 million total viewers. However, according to TV Line, part of the reasoning behind the last-minute renewal was in order to give those involved with the series a chance to wrap things up properly.

It's also entirely possible Fox is hoping to achieve syndication by ordering a final season, as the normal episode count desired for syndication is 100-episodes -- which the series would earn with a 13-episode fifth season. However, it's also possible the episode count will be much smaller than that. The milestone for syndication has actually been lowered to 88-episodes in recent years, meaning Gotham would technically have already hit that mark at the conclusion of its current season.

RELATED: Gotham Moves Even Closer to the Joker in New Jeremiah-Centric Trailer

Of course, more episodes means its easier to sell the syndication rights, so we'll just have to wait and see what Fox ultimately decides. For now, fans can rest easy knowing producers will have the chance to properly conclude the story they've been telling over these past four seasons.

Airing Thursdays at 8 p.m. ET/PT on Fox, Gotham stars Ben McKenzie as James Gordon, Donal Logue as Harvey Bullock, David Mazouz as Bruce Wayne, Robin Lord Taylor as Penguin, Cameron Bicondova as Selina Kyle, Erin Richards as Barbara Kean and Sean Pertwee as Alfred Pennyworth.