Two years after the Islamic State group lost the Libyan city of Sirte - its last stronghold in the country - the jihadists continues to launch attacks, including in the heart of the capital, profiting from government weakness and general chaos.The last attack claimed by ISIS targeted Tripoli's foreign ministry on Tuesday, killing three and causing major damage to one of the capital's supposedly most secure buildings. It followed two similar attacks, one in September against the headquarters of the national oil company that killed two and another that hit the electoral commission in Tripoli in May, when 14 were slain."ISIS has proved that it is capable of manoeuvring and of hitting strongly, two years after the loss of its stronghold in Sirte", said Libyan political analyst Jalal al-Fitouri. Its capabilities persist despite "the hunting down (of its fighters) in the Libyan desert by Libyan armed groups and the US military, which has launched numerous strikes against ISIS in the south", he said. ISIS has "benefitted from divisions" in the aftermath of Muammar Gaddafi's regime falling in 2011, Fitouri noted.Libya is divided between several rival entities, chief among them an internationally-recognised Government of National Accord led by Fayez al-Sarraj in Tripoli and a parallel administration in the east loyal to strongman Khalifa Haftar. 'The danger remains The political chaos and insecurity benefits jihadist groups, which have carried out numerous attacks in recent years, including more than 20 in 2018 against institutions linked to the GNA and Haftar's self-styled Libyan National Army. "In the absence of a monopoly on the use of force in the country, ISIS has been able to consolidate," said Mohammed al-Agouri, a professor at Benghazi university in eastern Libya. "It targets Haftar's and Sarraj's forces at the same time - as well as symbolic sites - in order to say 'We are still here!' and to recruit new foreign and local sympathisers", he said. "If the country's authorities do not unite... a loss of control (over the situation) could come at any moment", Agouri warned.The GNA has sought to improve security in the capital in order to convince Western nations to re-open embassies, which have been shuttered since 2014 due to violence. But Tuesday's attack once again exposed the extreme weakness of the GNA, which has repeatedly failed to impose its authority over militias in the capital since it came into being in 2016, despite promising security sector reforms guided by the UN. These reforms - announced after deadly clashes in September between rival groups in and around Tripoli - seek to reduce the influence of militias whose tentacles extend throughout the capital and its state institutions. 'Fertile ground' for ISIS Tuesday's attack against the foreign ministry risks extinguishing the GNA's hopes."The security situation appears to be good, but in reality it is not," GNA interior minister Fathi Bash Agha admitted to reporters several hours after the attack.He recognised that the promised reforms have not been implemented. He also implicitly accused some armed groups of not obeying orders, and acknowledged the GNA's weakness in the face of supposedly loyal militias. "The security chaos that persists creates fertile ground for Daesh," said Agha, using an Arabic acronym for ISIS.He spoke of his frustration over the lack of resources available to his ministry, including arms. The GNA on Tuesday renewed a call for a UN arms embargo imposed on the country since 2011 to be eased, "in order to bolster the security situation and fight terrorism". But analysts are dubious about this logic. "The international community will not allow Libya to import arms, because the government is weak in dealing with the militias," said Fayrouz al-Dali, a political science professor in Tripoli. "The fears of seeing these arms finding their way into bad hands persists", she warned.* Sign up to News24's top Africa news in your inbox: SUBSCRIBE TO THE HELLO AFRICA NEWSLETTERFOLLOW News24 Africa on Twitter and Facebook.