The Libyan civil war, also referred to as the Libyan revolution was an armed conflict in the North African state of Libya, fought between forces loyal to Colonel Muammar Gaddafi and those seeking to oust his government. The war was preceded by protests in Benghazi beginning on Tuesday, 15 February 2011, which led to clashes with security forces that fired on the crowd. The protests escalated into a rebellion that spread across the country, with the forces opposing Gaddafi establishing an interim governing body, the National Transitional Council.
The United Nations Security Council passed an initial resolution on 26 February, freezing the assets of Gaddafi and his inner circle and restricting their travel, and referred the matter to the International Criminal Court for investigation. In early March, Gaddafi's forces rallied, pushed eastwards and re-took several coastal cities before reaching Benghazi. A further U.N. resolution authorised member states to establish and enforce a no-fly zone over Libya, and to use "all necessary measures" to prevent attacks on civilians. The Gaddafi government then announced a ceasefire, but failed to uphold it, though it then accused rebels of violating the ceasefire when they continued to fight as well. Throughout the conflict, rebels rejected government offers of a ceasefire and efforts by the African Union to end the fighting because the plans set forth did not include the removal of Gaddafi.
In August, rebel forces began a coastal offensive, taking back territory lost weeks before and ultimately capturing the capital city of Tripoli, while Gaddafi evaded capture and loyalists engaged in a rearguard campaign. On 16 September 2011, the National Transitional Council was recognised by the United Nations as the legal representative of Libya, replacing the Gaddafi government. Muammar Gaddafi remained at large until 20 October 2011, when he was captured and killed attempting to escape from Sirte. The National Transitional Council "declared the liberation of Libya" and the official end of the war on 23 October 2011.
Amidst the aftermath of the civil war, a low-level insurgency by former Gaddafi loyalists still continued. There have been various disagreements and strife between local militia and tribes, including 23 January 2012 fighting in the former Gaddafi stronghold of Bani Walid, leading to an alternative town council being established and later recognized by the NTC. A much greater issue has been the role of militias which fought in the civil war and their role in the new Libya. Some have refused to disarm and cooperation with the NTC has been strained, leading to demonstrations against militias and government action to disband such groups or integrate them into the Libyan military.