Last night, news broke that President Obama would appear on an episode of the web sketch show “Between Two Ferns.” It was hard to believe. Then the episode was released this morning and it was even harder to believe: Obama didn’t just do “Between Two Ferns,” he did “Between Two Ferns.” He took host Zach Galifianakis’s harsh burns and hit back with even harsher ones — “If I ran a third time, it’d be sort of like doing a third Hangover movie. Didn’t really work out very well, did it?” — all in the name of promoting the Affordable Care Act. To find out exactly how it happened and what it was like to work with the Commander-in-Chief, we spoke with Scott Aukerman, host of IFC’s Comedy Bang! Bang! (the third season premieres on IFC on May 8) and executive producer and director of “Between Two Ferns.” He talks about how the White House let them get away with basically everything, how the president was easier to work with than some celebrities, and what it was like to give notes to the most powerful man on earth.

First things first, how did it happen?

Well, back in July, I, with a lot of other Funny or Die creators, met with Valerie Jarrett, who is a White House aide and one of Obama’s people. She was interested in making videos that would draw attention to the Affordable Care Act. So I pretty much went there as the ambassador for “Between Two Ferns,” just to say, “Hey! We’d love to do one with the president.”

Zach and I didn’t really think that anything would come of it. I mean, we’d been hearing rumors that President Obama has perhaps been interested in doing the show for quite a few years now and it never really panned out. And then months and months went by and nothing really happened with it. So, approximately three weeks ago, we heard that if it was ever going to happen, it was going to be now, so we should get ready and prep.

It really came around in a week. We heard he was interested, and Zach and I prepped and wrote up a treatment for them to look at, with what we wanted to do with the video and how we wanted to approach it. For me, the most important thing was that it didn’t come across as an advertisement. I really wanted it to be a funny, normal “Between Two Ferns” video. And the great part about it was that the White House was very accommodating of that and didn’t want to get in the way of our process. They didn’t want it to be just any kind of ad; they knew that it had to be funny and it had to be what we normally do for anyone to actually watch it. So, to their credit, they actually stayed out of our way with it. But yeah, within a week Zach and I had pitched what we wanted to do, they accepted it, and we flew out to the White House [laughs] and filmed it.

You said the idea had been floated before. Was the president familiar with the videos?

I can’t really speculate as to whether he is a fan of the videos or has seen them at all. Because every time we do one of these, we’re told the person is a fan of it and then you find out that the person has never seen it before. We were told that he took a look at the videos, but the most important thing to me is whoever’s idea it was — whether it was someone on his team or he himself — the fact that they would do it and the fact that they would keep it such a pure experience was really kind of amazing. I mean, they were easier to work with than some people we’ve had on the show before who should have been easy to work with. [Laughs.] So, it was really not only cool like, “Oh, it was cool we did it,” but it was actually a really good artistic experience.

How did you balance the need for it to be an ad and staying true to your brand?

The good thing about “Between Two Ferns” is it is a talk show, and people go on talk shows to plug things, so when we talked about it from that angle — I mean comedically — it makes sense that Obama would come on this show to plug this thing. It doesn’t really bother me. We’ve done integrated marketing in the shows before, and that’s the great part about fake talk shows, as well: There’s a long precedent of people doing talk shows in order to plug things, so it really didn’t bother us at all. What we were really concerned about is we wanted the preponderance of the video to be comedic, and not be a take on “Between Two Ferns,” where it really was just an ad that wasn’t funny at all. When the White House caught on with that, it was just smooth sailing. They were laughing just as much at what was going down. They couldn’t have been easier to work with.

Were there certain things that you had to go back and forth on or cut out?

Zach and I both at a certain point in the process were looking at each other going, “I can’t believe they’re letting us do this,” so pretty much the whole thing — we definitely couldn’t believe it. We kept expecting resistance, but there wasn’t any. It was really an incredible situation. We kept expecting them to say “No, no, no, you can’t have that joke,” or “No, no, no, you can’t be funny, it has to all be about the Affordable Care Act,” but to their credit they really wanted it to be what it was and got out of our way.

Can you walk me through the day of shooting?

We kind of surreptitiously went up to Washington, D.C. Zach was trying to keep a low profile, because if anyone spots him and says, “Hey, what is Zach doing in Washington, D.C.?” He was keeping it low pro. And day of was just — it was cool. We went out to the White House and they made it really easy for us to get in. Zach and I kept on being convinced that we would be turned away at the gates. [Laughs.] They’d say, “Nope, what do you think you’re doing?” But they were just really happy to see us. I felt like maybe there aren’t a lot of days where fun things happen at the White House — it’s usually very serious — so they were as excited to meet us, as we were to meet them.

I know traditionally you tape a lot for each “Between Two Ferns.” How much time did you really get with the president?

This one is pretty much what you see, is what you get. We did our usual process of Zach and I talking about what we were going to shoot, and then just did it live as it happened.

Did he pitch jokes?

I don’t think the president has to pitch jokes, he just says jokes and we enjoy them.

Do you remember one thing specifically that you enjoyed?

I just loved how he was going for the jugular with Zach regarding Bradley Cooper. I could tell the president was really enjoying that, and that’s obviously a funny sore spot for Zach. I really enjoyed that exchange.

You directed it. Did it ever feel normal? What was it like to give the president notes?

It was definitely something I was very concerned about. I remember asking someone, “Am I allowed to speak to the president?” And they said, “What do you mean?” And I said, “Well, you know, I’m the director, am I allowed to direct the video?” They said, “Of course!” It was strangely collaborative. It wasn’t that we went in there and did our regular process and they worked with us on it. I think people in Hollywood are so used to getting their own way with how they’re treated in interviews that they’re more difficult than people at the White House, who are just excited to be in there.

Was Zach really nervous to kind of be so combative with the president?

I think in general Zach is such a nice person and the “Between Two Ferns” persona that he has is so antithetical to his actual persona that he tends to be nervous whenever we do one of these things just because he doesn’t like really being a mean person. That said, everyone knows it’s all a joke and I could sense that the president was ready for him to be what these videos needed him to be, and was encouraging Zach to go for it.

Now that the video is out there, have you read any comments from conservatives saying it demeans the presidency?

I’ve seen some tweets about that kind of stuff. Like someone wrote like, “How does the president have time to do this?” And it’s like, how does anyone have time to do anything? The great part about it is, this president knows how to reach young people in a way that no other president has, and it’s very important that he reach young people with this issue. This is so much better and will attract so much more attention than him going on a Sunday morning show and talking about this issue when most people I know of this generation aren’t even up that early on a Sunday morning. The outrage about it is from a different generation, and the younger people really get it.

Why was Zach’s hair so weird?

You know, I have no idea. Why is Zach’s appearance ever the way it is?