Three insurgents attacked a NATO base on the perimeter of Afghanistan's capital Saturday but were killed by coalition forces before they could enter the compound in an attack that came hours after protesters stormed a United Nations Agency and killed at least 11, including seven foreigners.

NATO and Afghan police told The Associated Press in an email that three of its soldiers were wounded in Saturday's attack against Camp Phoenix, but that their injuries were not serious

There were reports of three attackers involved, according to Kabul Police chief Gen. Mohammad Ayub Salangi. He said two of them died when their vests detonated, a third was shot and at least one attacker was possibly wearing a suicide vest.

The base's gate had scorch marks on it, and an AP reporter at the scene saw some of the remains of at least one body belonging to a man who had blown himself up dangling from the gate.

Camp Phoenix is a base on the eastern edge of Kabul used mostly by American forces to help train the Afghan army and police.

An Afghan insurgent from one of the country's hotbeds of militancy is thought to be the ringleader of a bloody attack Friday on a United Nations compound as hundreds protested the purported burning of a Koran by a Florida pastor.

At least 11 people, including seven foreigners, were killed in the storming of the U.N. compound in the northern Afghanistan city of Mazar-i-Sharif. Two of the foreigners were beheaded, Reuters reported.

At least five Afghan civilians have been killed in the attack, according to Zalmai Ayubi, spokesman for the provincial governor of Kandahar. He said 46 others were wounded when the crowd of hundreds of protesters turned violent on Saturday and tried to burn some vehicles and shops.

It's unclear who killed and injured the protesters, but some were shot.

The demonstration in Mazar-i-Sharif turned violent when some protesters grabbed weapons from the U.N. guards and opened fire, then mobbed buildings and set fires on the compound, officials said. Demonstrators also massed in Kabul and the western city of Herat for peaceful demonstrations.

Afghan authorities announced the arrest of more than 20 people, including a militant from Kapisa province who they suspect was the ringleader of the assault, said Rawof Taj, deputy provincial police chief. Futher information about the suspects wasn't immediately available.

The topic of Koran burning stirred outrage among millions of Muslims and others worldwide after the Rev. Terry Jones' small church, Dove Outreach Center, threatened to destroy a copy of the holy book last September. The Florida pastor had backed down but the church claimed that it went through with the burning last month.

The protest began peacefully at the U.N. compound in in Mazar-i-Sharif, choosing an obvious symbol of the international community's involvement in Afghanistan to denounce the Koran's destruction. Mazar-i-Sharif also is on a list of the first seven areas of the country where Afghan security forces are slated to take over from the U.S.-led coalition starting in July.

Gen. Daud Daud, commander of Afghan National Police in several northern provinces, said those killed included four Nepalese guards who were working for the U.N. and two other foreigners employed at the complex. One other foreigner was wounded and died later. The nationalities of the other three foreigners was not known.

Interior Ministry spokesman Zemeri Bashary said four protesters also were killed and nearly two dozen civilians were wounded.

U.N. peacekeeping chief Alain LeRoy said the top U.N. envoy in Afghanistan, Staffan De Mistura, who is in Mazar-i-Sharif, believes "the U.N. was not the target."

"They wanted to find an international target and the U.N. was the one there in Mazar-i-Sharif," LeRoy told reporters at U.N. headquarters in New York.

U.N. Secretary-General Ban Ki-moon, who is in Nairobi, said it was "a cowardly attack that cannot be justified under any circumstances."

President Obama strongly condemned the attack and stressed the importance of work of the U.N. staff in Afghanistan.

"Their work is essential to building a stronger Afghanistan for the benefit of all its citizens. We stress the importance of calm and urge all parties to reject violence and resolve differences through dialogue," Obama said.

At the U.S. State Department, spokesman Mark Toner said the burning of a Quran in Florida was contrary to Americans' respect for Islam and religious tolerance. "This is an isolated act done by a small group of people and ... does not reflect the respect the people of the United States have toward Islam," he said.

Mohammad Azim, a businessman in Mazer-i-Sharif, said that clerics with loudspeakers drove around the city in two cars on Thursday to invite residents to the protest. After Friday prayers at a large blue mosque in the city center, clerics again called on worshippers to attend a peaceful protest.

When Abdul Karim, a police officer in Mazar-i-Sharif, went inside the compound to investigate, he saw the bullet-riddled bodies of three Nepalese guards lying in the yard, and a fourth on the first floor.

He said another victim with a fatal head wound died on a stairway to the basement of the compound, which was littered with broken glass and bullet casings. A man who was killed inside a room had wounds to his face and body, Karim said.

Several hundred people also protested the Koran burning at several sites in Herat, a city in western Afghanistan. Protesters burned a U.S. flag at a sports stadium in Herat and chanted "Death to the U.S." and "They broke the heart of Islam."

About 100 people also gathered at a traffic circle near the U.S. Embassy in Kabul.

The Gainesville, Florida church's website stated that after a five-hour trial on March 20, the Koran "was found guilty and a copy was burned inside the building." A picture on the website shows a book in flames in a small portable fire pit. The church on Friday repeated its claim that a Koran had been burned.

In a statement, Jones did not comment on whether his act had lead to the deaths. Instead he said it was time to "hold Islam accountable" and called on the United States and the UN to hold "these countries and people accountable for what they have done as well as for any excuses they may use to promote their terrorist activities."

Last week, Afghan President Hamid Karzai issued a statement calling the burning a "crime against a religion." He denounced the U.N. attack as a "disrespectful and abhorrent act" and called on the U.S. and the United Nations to bring to justice those who burned the holy book.

Karzai issued a statement late Friday calling the killings an "inhumane act" that was "against the values of Islam and Afghans." He said he planned to call officials at U.N. headquarters to express his regret and condolences from the people of Afghanistan.

The Associated Press contributed to this report.