Ten years after the US ambassador to Libya was killed in the eastern city of Benghazi, the country remains in turmoil and Washington is vying for influence with other foreign powers.
Islamist militants armed with automatic weapons and grenades stormed the US compound on the evening of September 11, 2012, at a time when the oil-rich North African country was torn by civil war.
They set the building ablaze, killing ambassador Christopher Stevens and IT specialist Sean Smith through smoke inhalation, and then also attacked a CIA annex where two contractors died, both former Navy Seals.
The assault, the first to claim the life of an American ambassador since 1979, deeply shocked the United States and caused a political storm for then president Barack Obama's administration.
The State Department, then headed by Hillary Clinton, was accused by its political foes of deadly mistakes and negligence over the bloodshed, which came 11 years to the day after al-Qaeda's 9/11 attacks.
Two years after the Benghazi attack, as more violence rocked Libya's capital Tripoli, the United States, like many other countries, shuttered its embassy there and has not reopened it since.
The diplomatic vacuum, and a disengagement from Libya under the next US president, Donald Trump, left the door open for other actors.
The main players have been Turkey, which has politically and militarily backed the Tripoli government, and Russia, Egypt and the United Arab Emirates, which supported a rival camp based in the country's east.
The US embassy remains based in neighbouring Tunisia, but this has not stopped Washington from seeking to wield "crucial influence on the Libya file," analyst Jalel Harchaoui told AFP.
"There have been positive moments such as the UN agreement in Skhirat in 2015, on which the Americans had worked hard," he said about the deal struck in Morocco on forming a Libyan national unity government.
There were also "darker moments", Harchaoui said, such as when Trump supported the eastern-based strongman Khalifa Haftar who launched a failed 2019-20 offensive against Tripoli.
US forces in Libya captured two militants in connection with the Benghazi attack and tried them in the United States. Mustafa al-Imam and Ahmed Abu Khattala were sentenced to 19 and 22 years in prison respectively.
The Benghazi attack had come almost a year after the fall of former dictator Moamer Kadhafi's regime, which was swept away by a popular uprising backed by a controversial NATO-led intervention.
The turmoil plunged the country into political and security chaos. Rival centres of power in the east and west are still vying for control, with various militias and mercenary groups in the fray.
While many diplomatic missions returned to Tripoli last year as the situation on the ground improved, Tunis-based US Ambassador Richard Norland only occasionally visits the Libyan capital.
Since March, two rival governments have been wrangling for control in Libya: one based in Tripoli and led by interim premier Abdulhamid Dbeibah since 2021; the other headed by Fathi Bashagha and supported by Haftar's eastern camp.
Fighting between rival militias in Tripoli late last month left 32 people dead and 159 wounded, according to a health ministry report.
The main concern for the United States for now appears to be keeping Libyan oil exports flowing amid the turmoil, said a European diplomatic source in Tripoli, as Russia's Ukraine war has battered global markets.
Norland has repeatedly called for elections to be held in the country, after the postponement of polls scheduled for December 2021 deepened the crisis. He also warned in June that Libya's rivals must not use oil "as a weapon".
Oil production in Libya reached 1.2 million barrels a day in late July, matching its daily average before an oil blockade was imposed between mid-April and mid-July by groups close to the eastern camp.
The US embassy in Libya said on Twitter last week that "the status quo is unsustainable, and it is incumbent on all external and internal actors to move toward presidential and parliamentary elections as soon as possible".