President Obama was worried about the safety of American troops and civilian workers in Afghanistan when he apologized to that country's president, Hamid Karzai, over the burning of Qurans at the largest US military base there, the White House said Friday.

"The president believed it was in the best interest of their safety to make it clear that an apology was appropriate, and that the American people -- and the American military, in particular -- does have respect for the religious views and the religious practices of the Afghan people," spokesman Josh Earnest told reporters.

There was no sign that Obama's apology -- or Karzai's subsequent appeal for calm -- was having much of an effect on public anger in Afghanistan, where a fourth straight day of violent protests left 7 more people dead—bringing the overall toll to at least 20.

But Earnest insisted that the clashes would not imperil overall US goals in Afghanistan, saying "we will work through these difficult circumstances and remain on track."

Obama's apology drew fire from at least one of the Republican candidates for president.

"It was the president's view that an apology was appropriate," to safeguard "the best interests, and safety, and welfare of our service members and our civilians who are currently serving in Afghanistan," Earnest said. "We have seen a spike in violence around this mistake."

Asked about reports that US commanders in Afghanistan had responded with a fresh round of training on how to handle the Quran, Earnest replied "It's my understanding that there are some new training methods that are being put in place" but referred reporters to the NATO-led International Security Assistance Force (ISAF) in Afghanistan.

More popular Yahoo! News stories:

• Geithner says Iran's 'saber-rattling' is behind spike in gas prices

• Ann Romney 'drives a couple Cadillacs,' Mitt Romney says

• Romney unveils economic plan in speech at Detroit's Ford Field

Want more of our best political stories? Visit The Ticket or connect with us on Facebook, follow us on Twitter, or add us on Tumblr. Handy with a camera? Join our Election 2012 Flickr group to submit your photos of the campaign in action.