A second day of violent, anti-American demonstrations spread across Afghanistan on Wednesday, as protesters seethed over the burning of Korans at a NATO air base, and Afghan politicians demanded harsh punishment for the offenders.

At least seven Afghans were killed and dozens were injured, according to the Interior Ministry, when protesters gathered in several cities across the country, throwing stones, burning tires and lighting effigies of President Obama. One crowd of men attempted to storm a fortified compound in Kabul where hundreds of American contractors live.

Security forces tried to quell the scattered protests — in some cases by firing on demonstrators — but the unrest showed no sign of dissipating.

In an Afghan parliamentary session, lawmakers backed demonstrators’ demands that the offenders be tried in an Islamic court, applying early pressure on President Hamid Karzai to act swiftly and assertively in meting out punishment.

The parliament issued “a resolution strongly condemning this act and demanded punishment of the culprits,” said Nazeefa Zaki, a lawmaker representing Kabul. Some members of parliament said the Koran burning was intended as an insult to Afghans. Others urged security officials and soldiers to wage holy war against Americans, a sentiment commonly expressed at the demonstrations.

Meanwhile, Afghan and NATO officials began a joint investigation into the incident, which has prompted apologies from top U.S. officials in Kabul and Washington and has fueled concerns that the outrage could threaten stability during a critical time in the war.

Visit to detention center

NATO and Afghan officials visited the Parwan Detention Facility, adjacent to Bagram Airfield, where the incident occurred, to “examine the circumstances surrounding the disposal of religious materials there,” according to a news release from NATO-led forces.

“The purpose of the investigation is to discover the truth surrounding the events which resulted in this incident,” said Gen. John R. Allen, the top U.S. commander in Afghanistan. “We are determined to ascertain the facts and take all actions necessary to ensure this never happens again.”

German Brig. Gen. Carsten Jacobson, chief spokesman for the NATO-led coalition in Afghanistan, said officials were urgently trying to trying to determine how many Korans and other religious texts were burned, and why. Answers to those questions, he said, would be necessary to prevent the public response to the “grave incident” from spiraling further out of control.

Western officials said publicly Tuesday that the books were taken to the incinerator by accident. “I assure you . . . I promise you . . . this was NOT intentional in any way,” Allen said in a statement.

But a senior U.S. military official, who asked to remain anonymous, said Tuesday that the Korans were removed from the prison library because they had radical or anti-Western messages scrawled in them. Jacobson did not confirm that assertion, but his comments to reporters Wednesday came closer to placing blame on poorly advised military officials.

“Some of the security brakes didn’t work,” he said. “And somewhere a decision was made that was highly inappropriate.” He added that the responsible parties were unaware of the nature of the materials.

Afghans, including the investigators appointed by the government, are split over whether the burning was unintentional or whether it reflected baser motives.

“We hope it was an accident, and we think it was,” said Siddiq Siddiqi, a spokesman for the Interior Ministry. “But at the end of the day, the investigation might find that it was a crazy person — that he was mad and that he did this on purpose.”

For his part, Karzai seemed keen on using the incident to advance his case that Afghans should take responsibility for the Parwan facility, the largest U.S.-run military prison in the country.

“The sooner you do the transfer of the prison, the less you will have problems and unfortunate incidents,” Karzai said at a meeting Wednesday with U.S. Deputy Defense Secretary Ashton B. Carter, according to a statement from Karzai’s office.

Last month, Karzai demanded that responsibility for the detention center be handed over to Afghanistan by the end of January. He has since extended that deadline until March 9. But U.S. officials continue to say Afghan institutions are woefully unprepared to detain or try suspected terrorists.

Karzai condemned the desecration of the Korans, but he did not go as far as many Afghan politicians, who squarely accused culturally insensitive American soldiers.

In addition to demonstrations throughout the capital, protests were held in Jalalabad, a typically safe city east of Kabul, and in Parwan province, where the Bagram base is located. Police in Logar province, south of Kabul, fired on demonstrators, killing one person, local officials said.

Fearing an escalation of violence, officials advised non-Afghans to take security precautions, lest they become targets. Last spring, a case of Koran-burning in Florida provoked an attack on a United Nations compound in northern Afghanistan that left seven foreigners and five Afghans dead.

Embassy locked down

“The embassy is on lockdown; all travel suspended. Please, everyone, be safe out there,” the U.S. Embassy posted on its official Twitter account Wednesday morning.

After issuing an apology Tuesday, Allen promised that all NATO forces in Afghanistan would complete training in the proper handling of religious materials by March 3.

For now, the charred remains of Korans burned at Bagram are being kept in drawers at the parliament and the Interior Ministry until needed as evidence, officials said.

Staff writer Craig Whitlock in Washington and special correspondent Sayed Salahuddin in Kabul contributed to this report.