In a warehouse packed with rocket launchers, grenades and rifles in the Libyan city Misrata, workers sweat as they install anti-aircraft guns on pickup trucks.
They are preparing to defend Tripoli, 200 km to the east, against military commander Khalifa Haftar, a self-proclaimed foe of Islamists who launched a surprise attack in April against a UN-backed government in the capital.
Initially shocked by the audacity of Haftar’s assault, armed groups in western Libya improved co-ordination and revived armouries from Libya’s 2011 revolution against Muammar Gaddafi to equip fighters.
The early disarray allowed Haftar’s Libyan National Army (LNA) force, allied to a parallel administration in eastern Libya, to reach Tripoli’s southern outskirts.
Since then defenders from Misrata and Tripoli have held off Haftar’s attack, even regaining some ground.
Western diplomats expect a long war — possibly until year-end — as both sides seem confident of prospects and have backing from foreign powers not pushing for a ceasefire.
For now, both sides seem intent on a military solution.
Turkey supplied drones and armoured trucks to Tripoli’s defenders, diplomats and Tripoli officials say. This helped balance previous supplies by Egypt and the United Arab Emirates to LNA, they say.
As important is the fighting spirit in Misrata, the main bastion against Haftar, where the largest mobilisation is underway since 2011 when the city helped topple Gaddafi.
Thousands of fighters left regular jobs to rush to the Tripoli front, supported by women cooking meals, rich businessmen and mechanics like Haj Sadoun and by his team of technicians.
“I started this workshop in 2011 during the revolution and never stopped. I’ve developed weapons skills since then,” he said. A dozen gun trucks are parked waiting to be served.
About 10 trucks are serviced daily by workmen who repair the mounted guns or fix protective metal plates.
It’s not only armed groups who support Sadoun — a donation box at the entrance is used by businessmen and residents to keep him going.
His warehouse has stockpiles of old guns looted from Gaddafi’s arsenals and now used as spare parts. Among the weapons lies an ammunition box carrying the name “Jamahiriya” — a term used by Gaddafi for Libya.
Misrata fighters make up the main force defending Tripoli, where armed groups are less organised and have flexible loyalties: Major Tripoli groups have not fully mobilised against Haftar, apparently seeking to keep their options open.
Misratis say Trippli groups lack the “Misrata spirit” developed in 2011 when Gaddafi besieged the city. Misratis see Haftar, an ex-general from Gaddafi’s army, as a copy of the autocrat.
Misrata troops already fought with Haftar in 2014 when the LNA flew air strikes to stop an advance of the force on Tripoli, held then by a government allied to Haftar.
This time Haftar, has not sent planes to bomb Misrata’s airport and steel plant, which some diplomats take as sign he wants to deal with Misratis.
The city is known for armed groups and Islamists, it also home to businessmen, many who did well under the old regime — it has Libya’s biggest port and steel and dairy firms serving the country.
Misrata is feeling the economic pinch. As an example, foreign banks are reluctant to supply letters of credit for the steel plant, said chairman Mohamed al-Faqih.
This has not shaken his resolve. “God willing we will finish the barbarian attack of the criminal Haftar,” he said.
Other community leaders rule out peace talks with Haftar.
“With Haftar a deal is not possible. Even if we lost 100,000 we would keep fighting,” said Mohamed Raed, lawmaker and chairman of the al-Nasseem dairy firm — Tripoli fighters are supplied with his ice cream.
“We have more than 30,000 fighters in Misrata but so far we have sent only 6,000,” he said.
Diplomats estimate Tripoli’s defenders at 3,000, similar to the dispatched LNA force. Only 1,000 are at the frontline, the rest are in forward bases, a diplomat said.
Both sides reject a ceasefire. Misrata officials say their forces will take Tarhouna, a town southeast of Tripoli controlled by LNA. Haftar is recruiting there.
“If Tarhouna is gone then Haftar loses the war,” said Raed.
The LNA strengthened positions near Sirte, controlled by Misrata.
“Every day women prepare meals to support our revolutionaries, meals, cakes,” said Halima Traim, who heads a Misrata charity. “We do this for our nation.”