WASHINGTON (AP) — The top U.S. diplomat in Kabul and a campaign adviser to President Barack Obama said Sunday the U.S. isn't rethinking its commitment to Afghanistan after violent protests left more than two dozen people dead, including two Americans shot inside a government ministry.

U.S. Ambassador Ryan Crocker and Robert Gibbs, Obama's former press secretary, said they believe Afghan President Hamid Karzai's fragile government could collapse and the Taliban would regain power if the U.S. were to walk away.

"This is not the time to decide that we're done here," said Crocker. "We have got to redouble our efforts. We've got to create a situation in which al-Qaida is not coming back."

Added Gibbs, "What the president's trying to do now is get us to a point where we can hand off the security of Afghanistan to the Afghans and that we can bring our troops home."

Their comments echoed arguments made by the Bush administration at the height of violence in Iraq, even as popular support for that war was waning. As in Iraq, American voters are questioning the utility of the decade-long Afghan conflict and whether a stable government there would be worth the loss in U.S. blood and treasure.

"If we decide we're tired of it, al-Qaida and the Taliban certainly aren't," said Crocker, who served in the Bush administration as ambassador to Iraq.

Obama apologized last week to Karzai for what U.S. officials said was an inadvertent burning of Afghan religious materials, including Qurans, at Bagram air base north of Kabul. Still, the incident fanned anti-Western sentiment across the country, leaving dozens of people dead, including four U.S. troops reportedly killed by their Afghan counterparts.

On Saturday, a U.S. lieutenant colonel and a major were found shot inside a heavily guarded Afghan ministry. The Taliban claimed responsibility and said the killings were in retaliation for the Quran burnings. The shootings prompted the unprecedented recall of NATO personnel working inside Afghan ministries, dealing a serious blow to the U.S. effort to rebuild the Afghan government through mentoring.

Story continues

The Pentagon on Sunday identified Air Force Lt. Col. John D. Loftis as one of the service members killed in the ministry incident. The 44-year-old airman from Paducah, Ky., was assigned to the 866th Air Expeditionary Squadron in Kabul.

Afghan officials, including the defense and interior ministers, canceled planned visits to Washington this coming week so they could remain in Kabul for consultations about how to quell the violence, Pentagon press secretary George Little said Sunday. He said Defense Secretary Leon Panetta "understands why that's a priority" and hopes to see them soon at the Pentagon.

Meetings with Panetta and Joint Chiefs of Staff chairman Gen. Martin Dempsey were on the schedule.

Obama's political opponents have seized on the series of events to cast doubt on the president's handling of the war, aligning themselves with voters frustrated by the slow progress.

GOP presidential candidate Newt Gingrich said that if Karzai "doesn't feel like apologizing then we should say goodbye and good luck, we don't need to be here risking our lives and wasting our money on somebody who doesn't care."

Republican hopeful Mitt Romney said he supports a continued U.S. military presence in Afghanistan, but said the recent shootings were proof that efforts to rebuild Afghanistan weren't going well.

"It's an extraordinary admission of failure for us to establish the relationships that you'd have to have for a successful transition to the Afghan military and Afghan security leadership," Romney said.

Crocker defended Kabul's reaction to the protests and said Afghan security forces are working to quell the protests.

"They've done so with loss of life on their side as well as some of the protesters, and they have been defending U.S. installations," Crocker said. "So they are very much in this fight trying to protect us."

Sen. John McCain, the top Republican on the Senate Armed Services Committee, said he agrees with Crocker that the U.S. can't leave yet. In fact, he said Obama should replace his timeline to withdraw troops with a longer-term agreement with Kabul to keep the country on track.

"Have no doubt that if Afghanistan reverts to a chaotic situation, you will see al-Qaida come back and it again (will) be a base eventually of attacks on the United States of America," he said.

At a NATO summit meeting in May in Chicago, the alliance and Karzai intend to determine a path for handing over full security responsibility to the Afghan government by the end of 2014.

Crocker, Gibbs and McCain spoke on CNN's "State of the Union." Romney was on "Fox News Sunday."