Libya apologised on Thursday to visiting US deputy secretary of state William Burns for an attack on the US consulate in Benghazi in which American ambassador Christopher Stevens died.
Burns was holding talks in Tripoli with Libyan leaders including new prime minister Mustafa Abu Shagour and Mohammed Magarief, head of the national congress, following last week's assault, in which three other Americans were also killed.
He was also due to attend a ceremony commemorating Stevens.
Foreign Minister Ashour Bin Khayyal apologised for the violence on Tripoli's behalf, praising Stevens as a "friend of Libya", a foreign ministry official said.
The four Americans died when gunmen attacked the consulate and a safe house in the eastern city of Benghazi.
The attackers were among a crowd protesting against a video made in California that mocks Islam and the prophet Mohammad.
"We do agree, Libyans and Americans that it is absolutely essential and urgent to bring those responsible for this horrible tragedy to justice just as quickly as possible and we're determined to work together to ensure that that happens," Burns told reporters in Tripoli.
"This is a shared loss, a terrible tragedy," he added.
"But it is also a reminder of the importance of renewing the determination of the US to do what Chris Stevens tried so hard to do. And that is to help Libyans realise the premise of the revolution, not allow it to be hijacked by extremists."
After meeting Burns, outgoing Libyan prime minister Abdurrahim El-Keib said the killing of Stevens was "definitely not representative of the moral values that we have here in Libya".
He said the video was "distasteful" and "does not reflect the feeling of the American people".
Matthew Olsen, director of the US government's National Counterterrorism Center, on Wednesday called the Benghazi assault a terrorist attack and said officials were looking at whether those involved had links to al Qaeda, particularly its North African affiliate, al Qaeda in the Islamic Maghreb.
The Libyan foreign ministry official said Burns and Bin Khayyal had discussed US involvement in the investigation, as well as broader security and economic cooperation.
Magarief, who apologised last week "to the United States, the people and the whole world" for the Benghazi attack, also agreed in a telephone call with US president Barack Obama that their countries would work together to investigate it.
Libya sacked its security chiefs for Benghazi after the attack and another official, tasked with employing militia fighters in the police in the east of the country, said on Thursday he had resigned because recruits were not being paid or supplied adequately.
Libya's interim government has struggled to impose its authority on a myriad armed groups that have refused to lay down their weapons since last year's overthrow of Muammar Gaddafi. The fight
ers often take the law into their own hands.