U.S. President Barack Obama has spoken to the top American commander in Afghanistan on the phone, to discuss the ongoing violence in the Central Asian country ensuing from Quran burning by American troops, while Washington welcomed Afghan President Hamid Karzai's call for dialogue and calm.

In his phone call to Gen. John Allen, the commander of U.S. and NATO forces in Afghanistan, Obama discussed the ongoing violence in the country and the killing of two U.S. servicemembers there on Saturday morning.

"The president thanked General Allen for all of the measures he is taking to protect our servicemembers and civilians in Afghanistan and to encourage calm," the White House said in a statement.

"We welcome President Karzai's statement this morning encouraging peaceful expressions, and his call for dialogue and calm," the statement said, adding that Washington "remains committed to a partnership with the government and people of Afghanistan, as we work to realize our shared goal of disrupting, dismantling and defeating al-Qaida and strengthening the Afghan state."

The two U.S. servicemembers were in the Afghan Interior Ministry when a local individual reportedly turned his weapon against them. "This act is unacceptable and the United States condemns it in the strongest possible terms," Pentagon spokesman George Little said.

After learning the incident, U.S. Defense Secretary Leon Panetta threw his support behind Gen. Allen's decision to recall all U.S. and NATO personnel working in Afghan ministries in and around Kabul.

The burning of Quran has sparked protests in Afghanistan for five consecutive days, leading to dozens of deaths and injuries. Obama and other top U.S. officials have apologized over the incident.

Washington and its allies, seeking to exit from Afghanistan by 2014, have reportedly been aiming at reconciliation talks with the Taliban.