Sunday's season finale of Silicon Valley marked the end of the road for Erlich Bachman.

The HBO comedy wrote out T.J. Miller's fan-favorite character in a rather unexpected and unceremonious fashion. After going to China to meet up with Gavin Belson (Matt Ross), Erlich joins Gavin at an opium den in Tibet, where Erlich gets so high that he can barely function. So the ousted Hooli CEO pays the owner of the drug den a wad of cash to keep Erlich there for five years.

And with that, Silicon Valley said goodbye to one of its most beloved characters. HBO first confirmed in May that Miller would not be coming back for the upcoming fifth season, writing in a statement that "the producers of Silicon Valley and T.J. Miller have mutually agreed that T.J. will not return for season five." The news left many wondering why there was a sudden parting, particularly since Erlich has been one of the show's biggest breakouts.

In a separate interview with The Hollywood Reporter ahead of the season four finale, co-showrunner Mike Judge offered a bit more clarity on Miller's exit. "It was kind of becoming clear that he didn't want to do the show anymore, but we wanted to leave it so that there would be an opportunity to come back at some point, " Judge said, explaining that the writers purposely left Erlich's storyline open-ended in the finale. "When the season was done, we talked to T.J. and said, 'Do you want to come back for part of it?' And he just wanted to move on."

Judge added that the producers intended to give Miller an out if he wanted to take it. "I think if somebody doesn't want to do it, you don't want to force them to. I certainly don't," said the executive producer, who also spoke with THR about the trajectory of the season and his six-season plan for the comedy. "It also wouldn't make for a very good work environment."

Now Miller is offering his side of the story. In a wide-ranging and, at times, eccentric interview (what else do you expect from Miller?), the actor reveals that HBO offered him a reduced role in the upcoming season, which he ultimately turned down in favor of leaving the show completely. He gets candid about why he ultimately walked away from the series, on whether he'll return to Silicon Valley in the future and why exiting the comedy "felt like a breakup."

How did you manage to leave the show mid-run? Didn't you have a contract that would keep you on the series?

They came to me and said, "Look, we're not going to pick up your contingency because we want to offer you doing five episodes out of the 10, or three episodes." And then I said, "Oh perfect, I had been wanting to ask if you guys would be open to me leaving the show." And then they suddenly said, "Wait, no, what? You can do whatever. What? What do you mean?" And that was so good of them. They said, "We just wanted you to have more time to do all of the things you're doing." And I said, "Well, the best way for me to be involved in the show is by no longer being on it." I swear to God, that's why the internet broke. Everybody was like, "What the f— are you talking about? You're on this successful show. Don't you want three more years of solid acting work and don't you want to be a famous television actor?" And I was like, "No, not really." I'd like to parasail into the Cannes Film Festival for The Emoji Movie because that's the next new funny thing that will make people laugh.

Why were the producers going to reduce your role in the first place?

Because they had to move the production schedule around. That's how heavy-duty my schedule is. Even the most successful comedy next to Veep on HBO was like this thing that I had to — I'm doing stand-up and I come back and I didn't sleep at all. I was incredibly busy. People joke about it but I'm the hardest-working man in show business, maybe. So they were like, "Let's make this easier for both of us." And I was like, "I think this is an amazing opportunity."

Why was leaving Erlich in a Tibetan drug house the right ending for your character?

I just thought it was so funny. They'd written a potential exit — an organic exit — and I just thought it was so funny. I also think it's interesting to leave a comedy at its height, one that is known for being cyclical. Everybody sort of criticizes [that part of it]. The only thing that you can talk down about the show and about Alec Berg, the showrunner for the first couple years, is that it's cyclical. If they fail, then they succeed, and then if they succeed, they fail. It's over and over. That's an old type of sitcom. That's Seinfeld, where Alec Berg used to work. It's recycling, it's network. This is HBO. And so I thought, what if suddenly the whole thing changed? Where's the guy at the house? He's gone. Richard [Thomas Middleditch] doesn't have a foil. Jian Yang [Jimmy O. Yang] comes to prominence. All these other characters will change and grow. I read something today that I thought was really sweet, which was that Erlich as a character never really belonged. I mean, really, think about that.

You don't think Erlich belonged in the show?

Yeah, nobody likes him. He doesn't have any friends. His only friend is Jian Yang, and Jian Yang f—ing hates him. I mean, he calls him a "fat loser." You don't say that to a friend. Erlich is just the person nobody wants. There's no reason for him to be there. He's conned his way into the whole situation. And so I thought it would be really interesting if suddenly they were able to rid themselves of him. If they had truly had enough of him, which is what they're always saying, then why wouldn't he just exit? What if they're really suddenly like, he's gone? Now what? Who does Richard have to complain about? Who is f—ing up their situation? Where is that confidence in the show? Where is that blowhard that everybody needs? Who is able to be negging without Thomas Middleditch being like, "I'll kill you, you little slut." So that all interested me, and most of all it made me laugh really hard. That was the impetus behind walking. That's sort of the impetus behind everything I do: It just makes me laugh. It's not about money, it's not about any of that stuff. It's certainly not about fame, which is destructing my relationships with my family. It's about things that are interesting and funny. That's what we need right now in a post-religious, post-meaning society.

You mentioned your schedule is crazy. How much of it was about that?

I was sick of telling my wife in earnest, "I'm going to slow down the schedule. We'll have more time to spend in New York." And even when I thought of leaving, she said, "Look, man, this is a character people love. They feel like they're friends with him." And although that makes for a terrible time at the airport because everybody high-fives me, grabbing your ass on the way to your f—ing plane to Omaha, Nebraska, to do stand-up comedy — these people want to know, "Do you really want to walk from what many would say is the cushiest situation in television? The platinum age of television?" And I said, "Yeah, I think that would be really interesting." If you're going to be unsafe and unstable, then let's see what happens.

If you wanted Erlich to be essential to the group, did you have any conversations with the showrunners, Mike Judge or Alec Berg, about possibly moving in that direction?

No, because that was the joke. He never was supposed to be present. I actually think the writing with Erlich gets funnier and funnier the more inessential and irrelevant he becomes. He's an annoyance. He was an obstacle to this beautiful, perfect thing that all of these people around him were going to create. I didn't talk to Alec because I don't like Alec, but I think Mike Judge and [co-executive producer] Clay Tarver are brilliant. Both of them were so accommodating, saying, "Well, what if you just do three episodes?" or "What if you just did the season finale?" Mike's idea was this Silk Road, Darknet storyline with Jian Yang and Erlich, and I loved that because I love Jian Yang. We're really like Laurel and Hardy. It's so funny. But I just thought that what the show has suffered from, what's bad about it, is that Richard is the CEO and then he isn't — but then he finds his way back to being CEO, and then once he finds his way back to being the CEO he says he doesn't want to be the CEO, and it's just the same thing over and over. … So I thought it would be really interesting [to leave]. And I don't know if they anticipated that or if it was yet another cliffhanger, something to be solved in the first episode of season five. But for me, television, unlike women and wine, does not get better with age. So I thought, "Wouldn't it be interesting to leave at the height of the success of the show?" Knowing that Kumail [Nanjiani] is brilliant, Zach Woods is the greatest improviser alive, Thomas Middleditch is one of the funniest people of all, Martin Starr is the deadpan comedian of our generation, what if I just stepped aside and let them continue the show and see what it becomes? I think that they made room for me to exit without ever really believing that I would walk away from the show. I think they thought I was a television actor and not a comedian.

What do you mean you're not an actor?

I'm not an actor; I'm a comedian. And I don't know how the f— I hoodwinked Hollywood into giving me a career in this. But I'm not sitting here saying, "I need more lines. I'm not funny enough." I'm not Thomas Middleditch. I'm me, the guy that thinks all of this is sort of ridiculous. It was a joke. Leaving was a joke that I thought would be a good joke because the show would grow and change. It seemed like a funny trick to play on everyone. It's just like, what if Kramer [Michael Richards] left in the middle of Seinfeld's height? And also what if that guy never said the N-word on a stage? What if that was the end of this character? I just thought that would be really fascinating. The response to my departure was really f—ing — there's really no other way to say it: It was just really heartwarming. It's like, wow, I guess I really did make something that people really dug. Just like Fred from Big Hero 6 or Weasel [from Deadpool].

Speaking of the fan response, what do you say to viewers who think they might not enjoy the show as much without you in it?

Christopher Evan Welch, who was 10 times funnier than I am, died. They lost someone to eternity who was much funnier than my character, and the show found a way to pivot and find its way. Erlich failed to prove to be meaningful or of any value to Pied Piper, and so he pivoted. That's what every company in Silicon Valley does. That's what America is. There is failure, but we pivot. My departure will do the same. Instead of dying, like everybody in my family would love, I go and make The Emoji Movie. It's worse for American culture.

Your character was such a fan favorite …

I would argue that I think Jared is funnier.

Sure, but Erlich was iconic out of the gate, and news of your exit spawned headlines like, "Is Silicon Valley Really Silicon Valley Without Erlich Bachman?"

Well, that's sort of what we're talking about. A lot of people are writing really interesting stuff about like, "Well, what does happen now?" And I love that. I want to step aside. Thomas Middleditch has always wanted to be a star. He's always wanted to be the star of the show. So I thought, really, it's an ensemble show, and if I step aside, the ensemble will each have a little more room. I guess some people are like, "Ah, I guess he's got too much going on, he's too big for the show." What are you talking about? It's, like, the best show on television, in my opinion, and I'm going and doing The Emoji Movie — and you can publish that because Sony knows we down to get motherf—ing paid globally. But I want to make movies for children. I want to have a schedule where I can have a fun, healthy relationship where we have lazy days. I also want to be the voiceover of How to Train Your Dragon theme parks. I'm doing a lot as a public servant and jester to the American public. As Kristen Stewart always says, "It's worldwide. It's worldwide." I feel like this is just an interesting thing to do, and I think if you're a fan, you're going to continue to be a fan — and I'll continue to work for you.

What were those final conversations with the network like?

It felt like a breakup with HBO. The final phone call was them going like, "Well, I don't think this is the end of Erlich. I still want to see him on television," and I was like, "I know but I think this is for the best." HBO has never treated me as an employee, always as a collaborator. They were understanding and said, "Look, if you really think that this is the move and that you'll be able to produce an hour special for us sooner than you would have if you were on the show, and if you feel right now under the current administration that you need to do stand-up because you need to be talking to the American public, then we support that." So they were very, very cool about it, and that final conversation was super friendly and sad. It was heartbreaking on my end.

Would you come back to the show even just for one episode?

[HBO programming president] Casey [Bloys] called me and said, "Hey, when do we start season five? Just kidding. Listen, we love that you're doing a special with us. I just wanted to check in." So I would love to work with them forever. It's just that I will never be on Silicon Valley again. That character, as you have seen, disappeared into the ether. And he did it at a time when no one was sick of him, when he had worn thin but not worn out. And even my father, when I told him that I was leaving, was like, "Yeah, we watched three or four episodes in a row and it's kind of one-note. I think it's a good idea." So I had the perfect father-son moment with him going, "Yeah, it's starting to kind of suck. It's a little stale. You're becoming a bit hack." If I can trust anyone in terms of comedy, it's my father. I thought this is definitely a good idea if he's saying, "I'm getting sick of watching you. Why don't you do something else?"

You could change your mind though, right?

No, I don't know if you've seen my work, but I don't particularly flounder and flip-flop on stuff. It's all pretty mediocre but delivered with a very solid fist, just like Erlich. Mike said, "We can do fewer episodes and a storyline just with you and Jian Yang." And then Clay Tarver was like, "Just do the show. What are you doing? Do the show, it's a fun show! You're great on it. Just make my life easier and do it!" I've been so lucky to work with them. Mike truly was like, "I guess I understand that the show can only change and grow and get better from here." By the end of the call, he was very much like, "Yes, I think this is a good place to sort of place the finale of Erlich." That's because they're really funny and they get it.

How did the other castmembers take the news of your departure?

This is where the publicist is supposed to step in and go, "Next question." But to be very frank, each of them took it a different way, and I think that has to do with their situation contextually. Some people, like Kumail, congratulated me and said, "This is fantastic. In some ways, I would do the same, but I think it's an interesting move. It's great." Some people, like Zach Woods — who's very neurotic and never reads the press, so it doesn't matter what you say about him in it — is such a sweetheart and somehow needs to make this [about] having a slow or healthier schedule overall. And then I think Martin Starr is a f—ing chanting Buddhist just like my wife, who's like, "Cool, man. This is life. It doesn't matter. There's not anything to it." So that was really, really nice, too. But the first person I called when I decided, and all my agents were like, "What are you doing?" — once everybody had said, "OK, OK, this is actually going to be good" — I called Jimmy O. Yang and I said, "Look, man, I'm leaving the show. … We've cultivated this double act that is so strong and I think you're the thing that I'm going to miss the most about the show."

Don't you feel like Erlich deserved a little more closure than he got?

I think that HBO and Alec Berg, specifically, kind of thought — and I guess apparently Thomas Middleditch — I guess they thought, "All right, maybe this is the end of the character. But like everything in the show, we'll sort of solve this and then it's back to normal." And they just didn't imagine that I would be in a position of being like, "I think that's it." I don't know how smart [Alec] is. He went to Harvard, and we all know those kids are f—ing idiots. That Crimson trash. Those comedy writers in Hollywood are f—ing Harvard graduates and that's why they're smug as a bug. … I think that in television you usually have one element that is very challenging, very frustrating. It's an obstacle, right? So you're doing the best work that you can do. Alec was that for me, and I think I was that for Alec. And a very good article was written that says that Erlich in the show is just this constant annoyance to Richard. And I think, in some ways, that is analogous to real life. I think in some ways Thomas Middleditch is — we have a contrarian relationship, like a big brother-little brother relationship. And this is also an opportunity for me to be like, "Let me just step off, dude. Like, just do your f—ing thing. You're amazing." I did a two-man improv show with him for a decade. He's amazing.

Will you watch the show going forward?

Oh, I don't watch the show now because I don't have time. I'm making comedy for people to laugh because their life is essentially tragic. I mean, I'm a fan of the show. I will be forever. If I have a terrible day, I'll probably tune in to see what Zach Woods said on an episode because you know he's a winner.

So, what's next for you?

In a world where the culture is fractured, and there is no real zeitgeist, everybody has to work on different platforms — multiple, or in my case, all of them. And I can't devote enough time to stand-up. The people from the show and the fans that get it, they're like, "We understand. You need to have a slower schedule and divert your focus." Like The Gorburger Show, stand-up, Deadpool and is there a Weasel spinoff that's funny and ironic other than being a sidekick? I have a movie at DreamWorks. And then the people that don't are like stupid f—ing websites like TV Overmind or something, and they're putting forth very reasonable, well-written logic for why this is so dumb and the only thing I'll ever be good at was this part in Silicon Valley. Yet none of them have seen Yogi Bear 3D, so they're all talking and chit-chattering and squawk, squawk, squawk — but none of them have seen Yogi Bear 3D. So they don't know that I've already done the best thing that I'll ever do. And because of that, there is no fear about any move in Hollywood for me. I'm just on the downslope. This is all a downward spiral, career-wise.

This interview has been edited and condensed for clarity.