(CNN) – President Barack Obama on Thursday defended his administration's handling of the Libya consulate attack, telling Jon Stewart on Comedy Central's "The Daily Show" that he will ultimately fix any problems involving security for diplomatic posts.
"The government is a big operation and any given time, something screws up," he said in the interview to air Thursday night. "And you make sure that you find out what's broken and you fix it."
– Follow the Ticker on Twitter: @PoliticalTicker
– Check out the CNN Electoral Map and Calculator and game out your own strategy for November.
Stewart pressed the president on the aftermath of the terror attack that killed four Americans at a U.S. consulate in Benghazi last month. The administration has faced scrutiny over why the post was not more robustly staffed with security.
The comedian said the administration's response did not play out in an "optimal" way.
"I would say, even you would admit, it was not the optimal response, at least to the American people, as far as all of us being on the same page," Stewart said.
The president replied: "When four Americans get killed, it's not optimal. We're going to fix it. All of it."
That remark sparked tough backlash from Republicans, who said it revealed a flip attitude toward the tragedy.
“Even from someone like the president, who has never known what these kinds of tragedies are about and the service and sacrifice that people make, it’s still just – I can’t even get angry,” McCain said on Fox News. “It’s just so inappropriate. And I’m sure that the families of those brave Americans are not amused.”
In Obama's interview, his second appearance on the show since taking office and sixth overall, Obama said his number one priority was the safety of Americans.
"And they will continue to get that over the next four years of my presidency," he said.
When Stewart asked about "confusion" over the Benghazi attack, the president laid out what he learned from the situation.
"(We) weren't confused about the fact that four Americans had been killed. I wasn't confused about the fact that we needed to ramp up diplomatic security around the world right after it happened. I wasn't confused about the fact that we had to investigate exactly what happened so it gets fixed. And I wasn't confused about the fact that we're going to hunt down whoever did it," the president said.
The show, however, was not without its lighter moments. Stewart joked that he was making a scrapbook and pulled out a pair of photos of the two presidential debates, according to pool reports. In one photo, Obama's wife, Michelle, is looking at the president angrily; in the other photo, she's smiling.
"Do you know which debate was which?" Stewart asked, poking fun at the president's widely panned debate performance at the first showdown earlier this month.
"Cute. Cute Jon," Obama said, smiling.