There was also deadly violence in the east on Wednesday. A suicide bomber crashed a car into a police bus, killing 14 people and wounding 16, said Zemeri Bashary, a spokesman for the Interior Ministry. Most of the casualties were police officers, he said.
There was no claim of responsibility, but it matched the pattern of Taliban attacks against government workers and security forces.
The bus was traveling to a police academy in Jalalabad city when it was ripped apart in the explosion, Nangarhar province government spokesman Ahmad Zia Abdulzai said.
In the demonstration in Takhar province in the north, protesters fought with police and tried to assault a German military outpost in the city of Taloqan, the provincial capital, officials said, adding that some 50 were injured.
The protest was triggered by an overnight NATO raid on the outskirts of the city. The coalition said four insurgents died in the operation and that two others were detained.
Night raids targeting insurgents regularly stir up controversy in Afghanistan, where angry residents often charge the next day that international forces go after the wrong people or mistreat civilians as they search compounds. Success by NATO in reducing civilian casualties and agreements to conduct night raids alongside Afghan forces have not managed to stem the tide of accusations.
Adding to the confusion, it is often difficult to know who is a militant in insurgent-heavy areas, where entire villages are often allied with the Taliban or other groups.
On Wednesday, hundreds of people gathered on the road from Gawmal to Taloqan and carried the four bodies — two men and two women — on platforms as they marched into the city. They shouted insults at Afghan President Hamid Karzai and the United States as they pumped their fists in the air.
"Death to Karzai! Death to America!" they yelled. Officials estimated there were about 1,500 demonstrators.
The crowd started looting shops and throwing stones at a small German base in the city. Gunfire could be heard in a number of neighborhoods and troops at the German outpost shot off rounds in an attempt to disperse the crowd outside their walls.
The German military said in a statement that the demonstrators threw hand grenades and Molotov cocktails into the base, wounding two German soldiers and four Afghan guards. The wounded German soldiers were both in stable condition, the military said.
At least 11 protesters were killed in the fighting, and 50 people were wounded, some of them police officers, said Faiz Mohammad Tawhedi, a spokesman for the Takhar government.
The raid late Tuesday killed two men and two women who were inside a home in an area known as Gawmal, provincial Gov. Abdul Jabar Taqwa said. He said that no one in his government was informed about the raid and that NATO acted unilaterally. NATO disputed that.
NATO confirmed it killed four people, two of them women.
One of the women was armed with an assault rifle and tried to fire on the troops, NATO said. The other woman pointed a pistol at the security force as she was trying to escape the compound.
It is rare for women to be part of an insurgent fighting force in Afghanistan, but not unheard of. There have been cases in the past of women fighting with the insurgency, including as suicide bombers.
NATO said the raid was conducted by a "combined Afghan and coalition security force" and an alliance spokesman said that the governor was contacted ahead of the raid.
"It is standard practice in Takhar province to contact the Afghan provincial leadership prior to an operation. In this case, calls were placed to the provincial governor six times prior to the operation," Maj. Michael Johnson said.
"We are aware of the claims of civilian casualties, and are looking into them," Johnson added.
President Hamid Karzai sided with the Afghan officials. He issued a statement condemning the night raid as having killed four members of a family and said it was not coordinated with Afghan forces.
"Despite repeated warnings that have been issued by President Karzai to top these uncoordinated NATO operations, it seems these types of operations still have not stopped," Karzai's office said in a statement.
He said the Afghan people should protest without turning to violence, but he blamed NATO for the protest.
NATO said that the raid targeted a man working with the Islamic Movement of Uzbekistan — an insurgent group that is powerful in the north. The man was involved in arms trafficking and building explosives, NATO said. The alliance did not say if he was killed or captured.
In the south, a NATO service member died Wednesday in an insurgent attack, the military coalition said. NATO did not provide further details or the service member's nationality.