The attacks were suspected to have been timed to coincide with the 11th anniversary of the Sept. 11, 2001, terrorist strike in the United States, el-Sharef added, with the militants using the film protest by Libyan civilians to mask their action.
Killed in the attack were U.S. Ambassador Chris Stevens, information management officer Sean Smith, private security guard Glen Doherty and one other American who has yet to be identified.
El-Sharef said the four were arrested from their homes on Thursday but would give no further details. He said it was too early to say if they belonged to a particular group or what their motive was. Libya's new prime minister, Mustafa Abu-Shakour, said authorities were looking for more suspects.
One of five private security guards at the consulate said the surprise attack began around 9:30 p.m. when several grenades that were lobbed over the outer wall exploded in the compound and bullets rained down.
The guard was wounded in the left leg from shrapnel. He said he was lying on the ground, bleeding and in excruciating pain when a bearded gunman came down the wall and shot him twice in the right leg, screaming: "You infidel, you are defending infidels!"
"Later, someone asked me who I was. I said I was the gardener and then I passed out. I woke up in hospital," said the guard, who spoke to The Associated Press from his bed at a Benghazi hospital. He spoke on condition of anonymity because he feared reprisals and reprimands from his employers.
The witness account came as protests of the obscure film, "Innocence of Muslims," continued in the Middle East.
An angry throng broke into the U.S. Embassy in Yemen, and clashes between security forces and demonstrators near the fortress-like embassy compound in the heart of Cairo left nearly 200 people injured and two police trucks burned.
Speaking at his Benghazi office, el-Sharef, who was running the Interior Ministry's operations room commanding security forces in the city during the attack, gave the most detailed account to date to come out of Libya of what happened the night of the attack. His version, however, leaves some questions unanswered and does not provide a definitive explanation on the motives behind the attack and the identity of the perpetrators.
No one has claimed responsibility for the attack. Some Libyan officials have pointed the finger at a hardline Islamist militia, the Ansar al-Shariah Brigades, one of multiple Libyan militias operating in the city. A spokesman for the group lavishly praised the assault for "protecting the faith and fighting for the victory of God Almighty." But he said the Brigades "did not participate as an organization. This was a popular uprising."
Adding to the confusion surrounding the attack is that it targeted the United States, a nation that played a key role in ridding the oil-rich, mostly desert nation of dictator Moammar Gadhafi. Washington also took the lead in launching the months-long NATO air campaign that crippled the late leader's forces.
Stevens was credited by most Libyans with organizing a political front made up of opposition groups to unite the uprising against Gadhafi's 41-year rule, mediating tribal and regional disputes.
The Benghazi attack also underlined the precarious conditions in Libya nearly a year after Gadhafi's fall, with a weak central government, militias operating as local governments, a destabilizing proliferation of weapons, and militant groups some inspired by al-Qaida that are active under the government's radar.
Stevens and another American were killed in the consulate during the initial violence, as plainclothes Libyan security were evacuating the consulate's staff to the safe house about a mile away, el-Sharef said. The second assault took place several hours later and targeted the safe house a villa inside the grounds of the city's equestrian club killing two Americans and wounding a number of Libyans and Americans.
The crowd built at the consulate a one-story villa surrounded by a large garden in an upscale Benghazi neighborhood in several stages, El-Sharef said. First, a small group of gunmen arrived, then civilians angry over the film. Later, heavily armed men with armored vehicles, some with rocket-propelled grenades, joined and the numbers swelled to more than 200.
The gunmen fired into the air outside the consulate. Libyan security guarding the site pulled out because they were so outmanned. "We thought there was no way for the protesters to storm the compound, which had fortified walls," he said.
Libyan security advised the Americans to evacuate at that point, but the advice was ignored, he said. There was shooting in the air from inside the consulate compound, he said.
At this point, el-Sharef continued, the crowd stormed the compound. The consulate was looted and burned, while plainclothes security men were sent to evacuate the personnel.
Stevens probably died of asphyxiation following a grenade explosion that started a fire, el-Sharef said, echoing what the Libyan doctor to whom Stevens' body was taken told the AP on Wednesday.
His account was corroborated by local journalist Ibrahim Hadya, who was at the scene. He told the AP that the consulate was stormed just as the evacuation was under way, with staff members smuggled out a side door that opens to a street other than the one where the militants and protesters gathered.
U.S. officials have said attackers broke into the main consulate building around 10:15 p.m. and set the compound on fire. Amid the evacuation, Stevens became separated from others, and staffers and security who tried to find him were forced to flee by flames, smoke and gunfire. After an hour, according to U.S. officials, U.S. and Libyan officials drove the attackers from the consulate.
The next attack came hours later. Around 30 American staffers along with Libyans had been evacuated to the safe house while a plane arrived from Tripoli with a joint U.S.-Libyan security group that was to fly them back to the capital, el-Sharef said.
El-Sharef said the original plan was for a separate Libyan security unit to escort the evacuees to the airport. Instead, the joint unit went from the airport to the safe house, possibly because they were under the impression they were dealing with a hostage situation, he said. The militant attack coincided with the joint team's arrival at the safe house, he said.
That the attackers knew the safe house's location suggests a "spy" inside the security forces tipped off the militants, el-Sharef said.
U.S. officials have not confirmed the account. They have spoken of an attack on the consulate's annex that killed two Americans, but said their report on the incident was still preliminary.
In Yemen's capital of Sanaa, hundreds of protesters chanting "death to America" and "death to Israel" stormed the U.S. Embassy compound and burned the American flag on Thursday.
Yemen's president, Abed Rabbo Mansour Hadi, quickly apologized to the U.S. and vowed to track down the culprits, just as Libya's president did. Egypt's Islamist President Mohammad Morsi, who had been slow to speak out on Tuesday's assault on the embassy in Cairo, promised Thursday that his government would not allow attacks on diplomatic missions.
The crowd in Sanaa swarmed over embassy's entrance gate. Men with iron bars smashed the thick, bullet-proof glass windows of the entrance building while others clambered up the wall. Some ripped the embassy's sign off the outer wall.
Inside the compound grounds, they brought down the American flag in the courtyard and replaced it with a black banner bearing Islam's declaration of faith "There is no God but Allah." They did not enter the main building housing the embassy's offices, some distance away from the entry reception. Demonstrators set tires ablaze and pelted the compound with rocks.
A thick column of black smoke rose out from inside the embassy compound. Witnesses said the protesters set ablaze a room housing security guards and torched several parked cars.
Yemeni security forces who rushed to the scene fired in the air and used tear gas to disperse the demonstrators, driving them out of the compound after about 45 minutes and sealing off the surrounding streets.
The embassy said nobody was harmed. "All embassy personnel are safe and accounted for," spokesman Lou Fintor said.
Yemen is home to al-Qaida's most active branch and the United States is the main foreign supporter of the Yemeni government's counterterrorism campaign. The government on Tuesday announced that al-Qaida's No. 2 leader in Yemen was killed in an apparent U.S. airstrike, a major blow to the terror network.
In Cairo, protesters clashed Thursday with police near the U.S. Embassy. Police used tear gas to disperse he protesters and the two sides pelted each other with rocks. But unlike Tuesday, when protesters climbed the embassy's walls and several of them breached its grounds, police kept the protesters away from the compound.
The Health Ministry said 224 people, including policemen, were wounded, but they mostly suffered light injuries. Twelve protesters have been arrested.
The clashes continued well into the night.
The spreading violence comes as outrage grows over a movie called "Innocence of Muslims" produced by anti-Islam campaigners in the U.S. that mocked Islam's Prophet Muhammad. The amateurish video was produced in the U.S. and excerpted on YouTube. It depicts Muhammad as a fraud, a womanizer and a madman in an overtly ridiculing way, showing him having sex and calling for massacres.
Anti-Islam film sparks assaults across Mideast
Libya • On Tuesday, the storming of the U.S. Consulate in Benghazi killed the U.S. ambassador, Chris Stevens, and three other embassy staff members. Libyan officials say the attack in Benghazi was a planned operation by heavily armed militants that may have been timed to mark the 11th anniversary of the 9/11 terror attacks on the U.S. and that the militants used civilian protesters as cover for their action.
Egypt • Angry youths climbed the walls of the U.S Embassy in Cairo and brought down the flag Tuesday.
Yemen • Hundreds of protesters angered by the film stormed the U.S. Embassy in the capital of Sanaa on Thursday and burned the U.S. flag, chanting "death to America" and "death to Israel."
Iraq • Several hundred Shiite hardliners protested Thursday in Baghdad's Shiite stronghold of Sadr City, and the leader of an Iranian-backed Shiite militia, Asaib Ahl al-Haq, threatened anti-U.S. attacks.
Iran • Dozens of protesters Thursday shouted "Death to America" outside the Swiss Embassy, which looks after U.S. interests there. Riot police kept the crowd at bay.
Reaction in Iraq
A Shiite militant group is threatening U.S. interests in Iraq as part of the backlash over an anti-Islam film it has described as "heinous."
The leader of the Iranian-backed Asaib Ahl al-Haq said in an interview Thursday that the amateurish video that ridicules Prophet Muhammad was unforgiveable, and called on all Muslims to "face our joint enemy."
The militia leader, Qais al-Khazali, told The Associated Press that the video "will put all the American interests Iraq in danger."
The U.S. Embassy in Baghdad remains the world's largest American diplomatic mission, with an estimated 15,000 employees.
Asaib Ahl al-Haq led deadly attacks against U.S. troops before the American military withdrew from the country last year. It is funded and armed mainly by Iran.