NEW YORK — US President Barack Obama denied on Thursday there had been "confusion" in his administration over the attack on the US consulate in Benghazi which killed four Americans.

Obama, appearing on Comedy Central TV's the Daily Show, professed confidence that he will win another four years in the White House on November 6, despite a tight race with Republican candidate Mitt Romney.

In answer to a question from Jon Stewart, anchor of the mock newscast, Obama said there had been no confusion over the Benghazi attack, after Republicans seized on the shifting narrative coming from his administration.

"I wasn't confused about the fact that we needed to ramp up diplomatic security around the world right after it happened," Obama said.

"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."

Romney has hammered the White House over its response to the September 11 assault on the Benghazi consulate, after first blaming it on protesters before concluding it was a pre-planned attack by Islamist militants.

Obama fired back Tuesday in a presidential debate, accusing Romney of trying to make political capital out of a national security issue and insisting he had declared the Benghazi assault an "act of terror" the day after it took place.

Romney challenged Obama on the assertion, only for the president to tell him to check the transcript of the remarks he made the day after the attack, when he said "no acts of terror will ever shake the resolve of this great nation."

The president also told Stewart in the show, to be broadcast later on Thursday, that he had laid out "every piece of information" on the Benghazi attack as soon as it became available.

"The picture eventually gets fully filled in," Obama said.

Stewart also asked Obama about communications problems within his administration following the attack and also security issues, saying the US response to the tragedy had not been "optimal."

"When four Americans get killed, it's not optimal. We're going to fix it. All of it," Obama said, referring to perceived security lapses around US diplomatic personnel in Libya.

"The government is a big operation and any given time something screws up. And you make sure that you find out what's broken and you fix it," Obama said, before saying he had made clear the need to protect the security of Americans.

"And they will continue to get that over the next four years of my presidency," Obama said.