Libya's new government urgently needs to rein in well-armed militias and other forces, and to give the country a sense of order.
New Libya's first task is solidifying national security
In late July, when Libya's then-deputy prime minster, Mustafa Abushagur, hosted a live online discussion with constituents, the issue of security was a popular concern. Mr Abushagur's answer: "We have already started the process of building a credible police force. However, it will take some time."
Time is not on Libya's side. The assassination of the US ambassador, Chris Stevens, in the eastern city of Benghazi on Tuesday underscored the urgent need for sweeping security improvements, and how much work the new government must do to impose federal authority across the country.
Since Muammar Qaddafi was killed in Sirte last October, signalling the end of the old regime, holding Libya together has been the first priority. The new government has never had a monopoly on force, a necessary prerequisite of a sovereign state. The militias that fought and won the rebellion pose a serious threat. So too do extremist groups that may have been responsible for the attack on the US consulate.
For Mr Abushagur, the moment is now. On Wednesday, he defeated the wartime rebel leader Mahmoud Jibril by just two votes in second-round voting in parliament to become Libya's first democratically elected prime minister. "There is so much to do," he told Reuters after his win. "It makes security high among my priorities."
But security has been high on Libya's list of priorities for months. The government remains unable to disarm rival factions, especially in the eastern region of Cyrenaica, or to incorporate them into a formalised security force. An example from the north-west was a showdown between Misurata and Bani Walid militias just after the election, when national forces kept their distance. The tribes had to negotiate their own truce.
Libya's police and army remain weak and ill-equipped, while local militias, in theory put under the ministries of interior and defence during the war, now seem to answer to no one. Without incentives, these groups will not disarm, and the state cannot force the issue. This must change.
Tuesday's attack should not overshadow the strides Libya has made since Qaddafi. General National Congress elections in July were by and large free and peaceful, and the interim legislature had already elected a president. In many parts of the country, life has returned to normal, with water and electricity restored, and the economy is rebounding.
Libya can maintain this momentum, despite this week's tragedy. International partners, including the US, have signalled continued support. But most importantly, Libyans need leaders willing to do the hard work, and take the risks, to build a political consensus that will get the guns off the street. Will Mr Abushagur be one such leader?