Tripoli, Libya (CNN) -- U.S. President Barack Obama strongly condemned Wednesday the killing of J. Christopher Stevens, Washington's ambassador to Libya, in a mob attack at a U.S. Consulate, fueled by anger over a film mocking Islam.
Obama called the attack "outrageous," and confirmed that three other Americans were killed by rockets fired at the U.S. Consulate in the eastern city of Benghazi.
"Chris was a courageous and exemplary representative of the United States," Obama said.
An "angry crowd" marched on the U.S. compound Tuesday, furious about an American-produced online film considered offensive to Muslims, said Libya's Deputy Interior Minister Wanis al-Sharif .
The U.S. mission in Egypt was also attacked Tuesday in response to the film depicting the prophet Mohammed as a child molester, womanizer and ruthless killer.
Stevens was the first U.S. ambassador to be killed in an attack since 1979.
Attack on the U.S. Consulate in Libya Attack on the U.S. Consulate in Libya
Protesters storm U.S. Embassy walls Protesters storm U.S. Embassy walls
Libya's Prime Minister Abdurrahim el-Keib apologized "to the American people and the government, and also to the rest of the world" for the "cowardly criminal act."
U.S. increases embassy security worldwide after Libya
U.S. Secretary of State Hillary Clinton identified a second victim as Sean Smith, a Foreign Service information management officer who was a 10-year veteran of the State Department, a husband and a father of two.
The two other victims have not been named.
Libya: Consulate attack 'cowardice'
Libya struggling to deal with militants
Images of the Libya attack
Consulate security staff opened fire after they heard gunfire outside the mission, Al-Sharif said.
"This led to more anger and this is when the consulate was stormed," he said, suggesting that people loyal to deposed dictator Moammar Gadhafi were aiming to create chaos among the protesters.
"Criminals managed to get in and they burned and ransacked the consulate," he said.
The U.S. mission is very badly damaged and was being looted on Wednesday, said a contractor working at the mission, who asked not to be named for security reasons.
He said he saw the bodies of all four Americans on the street Wednesday morning.
Attacks swing political campaigns towards foreign policy
Libyan Deputy Prime Minister Mustafa Abushagur said Stevens was "a friend of Libya, and we are shocked at the the attacks on the U.S. consulate in Benghazi."
"I condemn these barbaric acts in the strongest possible terms. This is an attack on America, Libya and free people everywhere," Abushagur said on Twitter.
The contractor in Benghazi said he could hear rocket-propelled grenade attacks Tuesday night.
Libyans were also killed, the contractor said, saying the victims were shot on the spot.
The bodies of the four Americans were at Benghazi airport, the contractor said, citing the Libyan minister of foreign affairs and a top immigration official in Benghazi.
Libya's governing party condemned the attack as a "criminal and cowardly act" and vowed to "track down the perpetrators and to maintain the country's security and the safety and security of its guests," Libya's official LANA news agency reported.
Stevens was the American envoy to the rebel movement that overthrew Gadhafi last year, based in Benghazi, the cradle of Libya's uprising.
Friends say Stevens loved Libya and had a deep affinity for the Libyan people, enjoying heading out into the field and getting to know people.
A speaker of Arabic and French, he was among the first U.S. diplomats sent to Libya in 2007 when the United States resumed ties with the Gadhafi regime.
Protesters attack U.S. diplomatic compounds in Egypt, Libya
The last time an American ambassador was killed by terrorists was in 1979, when the envoy to Afghanistan, Adolph Dubs, was kidnapped and killed during an attempt to rescue him, according to State Department records.
Stevens is the sixth U.S. ambassador to die by violence in the line of service. Two others have been killed in plane crashes.
The United States was taking added security measures to protect its citizens worldwide after Tuesday's attacks.
CNN's Stephanie Halasz, Jomana Karadsheh, Elise Labott , Lesa Jansen, Saad Abedine, Mariano Castillo and Kirsten Dewar contributed to this report.
U.S. Senator Pat Roberts (R-Kan.) released the following statement today regarding the attack on the American consulate in Benghazi, Libya that killed U.S. ambassador to Libya J. Christopher Stevens and three other embassy staff:
“My thoughts and prayers are with the families and all those affected by the attacks on the U.S. consulate in Libya. The murder of Ambassador J. Christopher Stevens and three Americans serving our country in Benghazi is a tragedy. It also reminds us that we must remain vigilant against our adversaries and our fight against terrorism. Unfortunately, hatred towards the American way of life persists in too many parts of the world. We have lost four more patriots and must not allow the enemy to take another.”
Congresswoman Lynn Jenkins released the following statement condemning the attack on the U.S. consulate in Libya that resulted in the deaths of four Americans, including the U.S. Ambassador to Libya J. Christopher Stevens.
“Last night we lost four brave Americans, including U.S. Ambassador Chris Stevens, in an attack by protestors on the U.S. consulate in Libya. I condemn this attack by violent extremists and the individuals responsible must be brought to justice.
“My thoughts and prayers are with all those affected by this tragedy and their families. Today we honor these American patriots, their extraordinary service, and their selfless commitment to diplomacy and freedom. I also express my unwavering support and gratitude for service members around the globe who continue to put themselves in harm’s way fighting against terrorism.”