Canada has suspended all meetings inside Afghan ministries following the killing of two American military advisers and ongoing riots in the country, the Foreign Affairs department said Sunday.

Department spokesman Yohan Rodericks said the move is a precaution due to recent security concerns. All Canadian staff are accounted for and safe.

Rodericks said officials are keeping a close eye on the situation.

The rioting, sparked by the burning of Qur'ans by U.S. troops last week, has left more than two dozen dead.

On Sunday, Germany followed Britain and NATO's decisions to temporarily withdraw experts from ministries in Kabul after the two U.S. advisers were shot dead inside the heavily guarded Afghan Interior Ministry.

The Taliban claimed the Saturday killings of a U.S. lieutenant colonel and a major were in retaliation for the Qur'an burnings.

Germany's Development Ministry said about 50 experts and other international advisers working on its behalf were pulled out of ministries and government buildings in Kabul as a "precautionary" measure.

The decisions by all three have put the administration of U.S. President Barack Obama on the defensive with top officials saying Sunday the objective in Afghanistan hasn't changed despite the violence.

U.S. Ambassador Ryan Crocker said he believes Afghan President Hamid Karzai's fragile government could collapse and the Taliban would regain power if the U.S. walked 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 Qaeda is not coming back."

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

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

Obama apologized last week to Karzai for what U.S. officials say was an inadvertent burning of Afghan religious materials, including Qu'rans, at Bagram air base north of Kabul.

The incident fanned even more anti-Western sentiment across the country.

On Sunday, enraged Afghans hurled grenades at a U.S. base in northern Afghanistan and clashed with police in incidents that left scores injured and at least two Afghans dead.

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

Republican hopeful Mitt Romney 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.

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

With files from The Associated Press