The protests were in response to the burning of several Korans at the largest NATO air base in the country on Monday night, which the military afterward said was a inadvertent mistake and apologized for profusely.
A second angry protest by an estimated 4,000 people armed with rocks and sticks was surging along the Kabul-Jalalabad road in the east of the city and moving toward central Kabul. At least seven police vehicles were seen retreating as the crowd hurled a barrage of stones. A few of the protesters were waving the white flag of the Taliban and some were wearing head wrappings with a jihad slogan written on them: "I sacrifice myself."
Protesters throughout the city were also shouting "Death to America."
There were reports of demonstrations in at least six other provinces, but it appeared they were peaceful, at least initially.
The potential scope of the fallout from the burning of several copies of the Koran by American military personnel this week became chillingly clear on Thursday as a man in an Afghan Army uniform shot and killed two American soldiers. Seven Afghans were killed in three provinces on Thursday and many more were injured, most in skirmishes with Afghan security forces.
Afghan officials quoted Thursday from a letter from President Obama in which he, among other things, apologized for the Koran burning. For President Hamid Karzai, the episode has fast become a political thicket. He and other government officials share with the Afghan populace a visceral disgust for the way American soldiers treated the holy book, but they recognize that violent protests could draw lethal responses from the police or soldiers, setting off a cycle of violence.
Complicating matters is that some of Mr. Karzai's allies in Parliament and elsewhere, including former mujahedeen leaders, have openly encouraged people to take to the streets and attack NATO forces. Mr. Karzai has not spoken out against them publicly, but his government's overall message on Thursday suggested that he did not want more violence.
Mr. Karzai met with members of both houses of Parliament at the presidential palace and urged them to help to try to contain the protests.
"The president said that 'according to our investigation we have found that American soldiers mistakenly insulted the Koran and we will accept their apology,' " said Fatima Aziz, a lawmaker from Kunduz who attended the meeting.
"He said, 'Whoever did this should be punished, and they should avoid its repetition. Insulting holy books and religion is not acceptable at all.' "
Ms. Aziz, who said she wept when told of the Koran burning, also said Mr. Karzai told Parliament members that the protesters' violent response was "'not proper.' "
Ms. Aziz, along with many educated Afghans, some of whom registered their views on Facebook, said she was dismayed by the exploitation of the incident for political gain and accused Iran and Pakistan of behind-the-scenes manipulation. Both countries would like to see the American military under pressure, and the reaction to the Koran burning has accomplished that.
The Taliban released two statements on Thursday: one urged Afghans to attack foreign troops and installations as well as Afghan forces who are defending them, and the second urged Afghan security forces to turn their guns on their NATO colleagues.
"The Islamic Emirate of Afghanistan calls on all the youth present in the security apparatus of the Kabul regime to fulfill their religious and national duty," the statement said, "to repent for their past sins and to record their names with gold in the history books of Islam and Afghanistan by turning their guns on the foreign infidel invaders instead of their own people."
Mohammed Salih Suljoqi, a lawmaker from Herat, said the episode "has been used as a tool of propaganda."
"The noble and pure emotions of our fellow countrymen are being misused by the intelligence agencies of neighboring countries," he said, adding that some groups "are trying to destabilize the situation and lead the country into chaos."
"All these tragic incidents can spread a dark shadow and negatively impact the relationship of Afghanistan and the United States," Mr. Suljoqi said.
Reporting was contributed by an employee of The New York Times from Nangarhar Province.