Fans of “Silicon Valley” were shocked when HBO announced that T.J. Miller would be departing the show, and watched Sunday’s season finale to see beloved tech goofball Erlich Bachman apparently banished to Tibet for five years, seemingly closing the door on his character.

For Miller, the episode brought about an exit that both bitter and sweet, giving a candid interview to The Hollywood Reporter in which he explains he decided to quit after producers told him his character’s role was going to be reduced in the upcoming fifth season.

“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,” Miller tells THR.

RELATED: T.J. Miller Leaving ‘Silicon Valley’, Won’t Be Returning For Season 5

“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,” he adds.

As the in-demand comedian explains, his busy schedule actually led production to be rescheduled around him. “Because they had to move the production schedule around. That’s how heavy duty my schedule is,” reveals Miller. “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.'”

And while he still sees leaving “Silicon Valley” as an “opportunity” to engage in other projects, he admits that ending his relationship with the show wasn’t all that different from ending a relationship with a lover.

“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,'” says Miller, adding: “So they were very, very cool about it, and that final conversation was super friendly and sad. It was heartbreaking on my end.”

RELATED: T.J. Miller Parasails Into Cannes During ‘Emoji Movie’ Stunt: ‘C’est Bon!’

Looking at the big picture, Miller sees his acting career as something of a fluke, explaining that “I’m not an actor; I’m a comedian. And I don’t know how the f**k I hoodwinked Hollywood into giving me a career in this.”

Hr admits that he’s “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**king — 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.”