In an interview with Rolling Stone, Rob McElhenney talked about the decision to make his It's Always Sunny in Philadelphia character gay.

Mac came out at the end of the show's most recent season, which aired last year.

The show had previously explored the possibility that Mac is gay.

(Related: Rob McElhenney: Pro-gay marriage, raised in a gay family.)

McElhenney, who created the show, said that Mac's sexuality lampoons conservatives who protest too much.

“It was actually born more out of his intense, ultraconservative, right-leaning principals,” he said. “We always take whatever viewpoint any character has to the extreme. We have certainly mined plenty of comedy out of the extreme right and the extreme left. We were looking at Mac at one point, and I was like, 'He is such an arch-arch Catholic conservative when it suits him, and when it doesn’t, he drops that.' And most of the people I know in that camp tend to be fairly homophobic. So we began going down that road: Let’s satirize that hard Christian conservative who is also intensely homophobic. OK, so what’s the next step from there? And that’s when I thought, 'Let’s just make him gay.' What we realized is, if you look back over the seasons, it almost worked retroactively.”

“I didn’t expect it, but there was a massive outpouring from our LGBTQ fans, who were really upset [at Mac's going back into the closet]. They felt like, 'Oh, wow, he finally came out. We feel represented. This is a really fun and cool character.' That made them feel like it was a chance for us to do something different, and we put him back in the closet. We thought about it over the off-season, and I realized, 'Man, that is a bummer. We had an opportunity there, and we screwed it up.' And we ameliorated that in the season after, where Mac winds up coming out and staying out, and the response was so overwhelmingly positive, certainly from the people that we cared about, though of course there was a negative response from a segment of the audience we didn’t care about.”

“It felt good that we were recognizing a part of our audience in a way that was not pandering, that wasn’t offensive or upsetting or a caricature. We weren’t creating a gay character for comedic effect, that was there just to be gay and to be funny because he was gay, but a very complex, very disturbed, very fucked-up and awful character, who happens to be gay. And we ran with that,” he said.

It's Always Sunny in Philadelphia returns for its 14th season on September 25 on FXX.