Libya's military strongman Khalifa Haftar launched an offensive three months ago to seize the capital, the seat of the internationally recognised government.
His forces, halted at the south of the city after counter-attacks, have been blamed for an air strike that killed dozens of migrants housed in a centre on the outskirts of Tripoli late Tuesday. They have denied the accusation.
Here is an overview of Haftar's bid to take the capital.
- Launched -
Haftar announces the move on Tripoli by his self-styled Libyan National Army (LNA) on April 4 with an online message: "The time has come."
The retired general refuses to recognise the Government of National Accord (GNA) based in the capital, and has set up a parallel administration in eastern Libya while also controlling much of the south.
He claims his campaign is aimed at removing "terrorists".
His forces briefly seize Tripoli's international airport, unused since it was destroyed in fighting in 2014, but are pushed back on April 5.
- First air strikes -
On April 6, GNA forces launch the first air strikes on Haftar's positions around 50 kilometres (30 miles) south of Tripoli.
The next day Haftar's forces say they carried out their first air strike on a Tripoli suburb.
Pro-GNA forces announce a counteroffensive called "Volcano of Anger".
On April 8, LNA warplanes carry out an air strike against Tripoli's only functioning airport, Mitiga.
Rockets hit central Tripoli late on April 16, for the first time since the offensive was launched, killing six people. Haftar's forces are blamed.
- International involvement -
On April 19, the White House says that President Donald Trump recognised Haftar's "significant role in fighting terrorism and securing Libya's oil resources".
Clashes south of Tripoli intensify.
On April 24, Sarraj accuses France of backing Haftar, saying its support prompted him to move on Tripoli. France rejects the accusations.
On May 7, a report to the UN Security Council says experts believe that missiles used by the LNA or its allies may have been supplied by the United Arab Emirates.
The UAE, Egypt and Saudi Arabia are seen as Haftar's key supporters.
Haftar accuses Turkey and Qatar of supplying weapons to his rivals.
On May 23, UN envoy Ghassan Salame says between "six and 10 countries" are funnelling arms, cash and military advice to Libya.
- Political initiative -
On June 16, Sarraj announces a new political initiative to end the conflict, including elections before the end of the year.
Haftar's "army has been broken", he claims.
But on June 20 Haftar dismisses Sarraj's proposition and vows to press on. He announces his own plan to revive the "democratic process", which also includes elections.
- Haftar base seized -
On June 26, GNA forces retake the town of Gharyan, the main supply base for Haftar's LNA since the start of their offensive.
The LNA accuses Turkey of a role in the surprise attack on the town, about 100 kilometres southwest of Tripoli.
Turkish ships and interests had become "legitimate targets", they say on June 29.
Ankara responds that it will retaliate with force to any attacks.
The following day it announces that the LNA is holding six Turkish nationals; it demands their release, saying otherwise "Haftar elements will become legitimate targets".
The six, who are sailors, are freed on July 1.
- Migrant massacre -
Late on July 2 an air strike hits a migrant detention centre in a Tripoli suburb, killing at least 44 people and wounding around 100.
There is no claim of responsibility but the GNA blames the air raid on Haftar's anti-government forces. Haftar's forces deny any responsibility.
UN Secretary-General Antonio Guterres calls for an independent investigation. His envoy Salame denounces a possible "war crime". The UN Security Council sets an emergency meeting.

