UPDATE 2-United Nations condemns attack on U.S. diplomats in Libya
* UN says no justification for Benghazi attack
* Libya envoy says attack "gravely damages" Islam image
* Security Council says attack unjustifiable, heinous act
UNITED NATIONS, Sept 12 (Reuters) - The United Nations strongly condemned on Wednesday an assault that killed the U.S. ambassador to Libya and three embassy staff and said the "horrific and tragic attack" further spotlighted the security challenges facing Libyan authorities.
The Tuesday attack on the consulate in Benghazi and a safe house refuge was carried out by Islamist gunmen blaming America for a film they said insulted Prophet Mohammad.
"The United Nations rejects defamation of religion in all forms. At the same time, nothing justifies the brutal violence which occurred in Benghazi," U.N. Secretary-General Ban Ki-moon said in a statement.
Ban said Libyan employees of the U.S. consulate also had been killed but he did not specify how many. Libya's Deputy U.N. Ambassador Ibrahim Dabbashi said "less than 10 victims" were Libyan security force members.
"We condemn in the strongest terms this attack on a diplomatic facility," U.N. Undersecretary-General for Political Affairs Jeffrey Feltman told the U.N. Security Council during a regularly scheduled briefing on Libya on Wednesday.
The U.N. Security Council described the violence in Benghazi as a "heinous act" and in a statement strongly condemned the attack on the U.S. consulate in Libya and also another assault on Tuesday on the U.S. embassy in Cairo.
"Such acts are unjustifiable regardless of their motivations whenever and by whomever committed," German U.N. Ambassador Peter Wittig, president of the Security Council for September, told reporters on behalf of the 15-nation body.
The statement was unanimously agreed on by the council, including Russia, which was the harshest critic of last year's NATO operation that led to the end of Muammar Gaddafi's 42-year rule when his forces fled Tripoli in August 2011.
Moscow has repeatedly cited the Western and Arab-backed "regime change" in Libya as a key reason for its opposition to stronger Security Council action on the Syria's civil war.
Dabbashi told the Security Council that an investigation of the Benghazi attack was under way and that Libyan authorities would bring those responsible to justice.
"This attack gravely damages the image of Islam," he said.
While Libya held a largely peaceful election in early July, its first national and free vote in 60 years, Dabbashi said the reality was "the government is still not governing the whole territory of Libya and there are some groups and persons who are outlawed and the government could not ... contain all of them."
A bomb was thrown at a convoy carrying the head of the U.N. mission to Libya, Ian Martin, in April, but no one was hurt. In June a rocket-propelled grenade hit a convoy carrying Britain's ambassador to Libya, injuring two of his bodyguards.
Ban announced on Wednesday that former Lebanese minister Tarek Mitri would replace Martin as head of the U.N. political mission in Libya on Oct. 14.
Feltman said the attack on the U.S. consulate in Benghazi was "one example, but not the only one, demonstrating that foremost among the challenges and expectations facing the Libyan people and authorities is security."
"These challenges are manifested by the presence of arms outside state control, lack of clarity and competition over security responsibilities between and within relevant ministries and institutions and the continued prevalence of armed brigades," said Feltman, the former top U.S. diplomat for the Middle East who described Stevens as a friend.
Nine months of fighting in Libya ended last October when Gaddafi was captured and killed by rebels. But Libyan authorities have struggled to control armed groups who are now competing for power in the north African country.
Libyan revolutionary brigades still have thousands of people in custody and the U.N. human rights agency has accused them of torturing detainees, many of whom are sub-Saharan Africans suspected of fighting for the toppled government of Gaddafi.
Ban said in his latest report to the Security Council on Libya that he was "deeply concerned about the length of detention and treatment of detainees."
Feltman said the urgency with which the security vacuum in Libya needed to be addressed had also been highlighted by a spate of recent attacks on Sufi shrines.
Ultra-conservative Muslims bulldozed shrines sacred to Sufi Muslims in Tripoli and the western city of Zlitan in late August, stoking fears of the spread of factional violence.