If Bryan Cranston didn't appear in a 1998 episode of The X-Files, he probably wouldn't have portrayed Walter White in Breaking Bad. The actor starred as the complicated anti-hero in AMC's award-winning crime drama from 2008 to 2013. Vince Gilligan developed the show years after he worked as a writer and producer on The X-Files. Here's how the sci-fi series paved the way for Cranston on Breaking Bad.

Breaking Bad remains as one of the best shows in recent memory. Cranston played a high school science teacher who went down a dark path after a cancer diagnosis. As a family man, Walt wanted to support his loved ones in case his health took a turn, so he became a meth cook. Not only was he capable of cooking meth, but he was also exceptionally good at it — with the help of a former student, Jesse Pinkman (Aaron Paul). In time, Walt transformed into the drug kingpin, Heisenberg, but as his reputation grew, so did the secrets. The character dug a hole that he could no longer crawl out of by losing sight of his morals. By the end of the series, Walt came to terms with how fulfilling it was to be in power, despite the inevitable sadness that came as a result of his decisions.

Related: Every Breaking Bad Actor In The X-Files

Cranston wasn't a shoo-in for the role on Breaking Bad, but thankfully, his past performance on The X-Files sure left an impression with Gilligan. The actor appeared as Patrick Crump in "Drive," an episode featured in the show's sixth season that was written by Gilligan. Patrick was suffering from a bizarre health condition (caused by a device) that put a debilitating amount of pressure on his brain, forcing him to drive from the area at increasing speeds. Patrick ended up kidnapping FBI agent Fox Mulder (David Duchovny), who was investigating the phenomenon. He was an extremely awful man, portrayed as a racist and anti-Semite — but, as Gilligan made clear in a past interview with The Television Academy Foundation (via YouTube), he wanted Cranston to play a villain that viewers will feel a sense of sympathy for. While developing Walt for Breaking Bad, Gilligan was reminded of Cranston's performance as Patrick, so it was a simple choice in his mind when it came to casting.

Cranston's X-Files Character Mirrored Walter White

Breaking Bad X-Files

Even though Patrick was not very likable, there was a sense of humanity embedded in the character. During the episode, Patrick and Mulder started to work out their differences. Before they could come up with a viable solution, Patrick was killed by his condition. Cranston made viewers care about Patrick's fate despite his despicable qualities. In many ways, Walt's arc mirrored this complicated character development. Though he had good intentions at first, Walt veered away from being the "good guy." He made terrible decisions and put a lot of people at risk. Despite those complicated layers, viewers were invested in what happened to him in the end.

Portraying a villain with humanity in The X-Files left a long-lasting impression on Gilligan. The two professionals didn't work together in the decade between series, but Gilligan didn't forget Cranston's portrayal as Patrick. When the lead of Breaking Bad was being cast, the network had their sights set on Matthew Broderick and John Cusack. Gilligan fought for Cranston and argued that the actor's recent work in Malcolm in the Middle wasn't indicative of his potential on a full-blown drama. Gilligan got his wish and the rest is history.

Next: Breaking Bad Season 4 Had A Clever X-Files Easter Egg