Fans of “Magnum P.I.” were left saddened when CBS decided not to cancel the series after four seasons last month.

However, the reboot of the iconic 1980s detective drama proved to be more durable than expected when another network stepped in to pick the show up for its two more seasons.

On Thursday, Deadline reported that NBC is renewing the show for 20 episodes, split over two 10-episode seasons.

READ MORE: ‘Magnum P.I.’, ‘MacGyver’ Showrunner Peter Lenkov Fired Over Claims Of Toxic Work Environment

According to Deadline, as soon as CBS announced its decision, Universal — which produces the show — began looking for a new home for the show, in which Jay Hernandez portrays the Hawaii-based private investigator made famous by Tom Selleck in the original, which ran from 1980 until 1988.

As Deadline points out, “Magnum P.I.” is following a similar trajectory to “Brooklyn Nine-Nine”, which was axed by Fox after five seasons and subsequently resurrected by NBC, where it aired for three more.

Following the news, Hernandez took to Twitter to thanks fans for their “love & support” in helping to bring the show back from the dead. “Time to dust off the Aloha shirt,” he wrote.