BENGHAZI, Libya -- The last buildings occupied by Islamic State militants in Sirte have fallen into hands of Libyan fighters on Tuesday, officials said, as anti-IS fighters celebrated in the streets of the final IS stronghold in Libya.

Ahmed Hadiya, the head of the media centre for the anti-IS operation, told The Associated Press: "This is the last major battle, but it is not the end of military operations, nor the declaration of liberation."

Hadiya said that 12 fighters were killed on Tuesday in "intense fighting."

The United States threw its support behind the anti-IS operation in August, helping break weeks of stalemate with dozens of airstrikes.

While the extremist group has lost its major base in Libya, IS militants might seek sanctuary elsewhere -- such as Libya's lawless southern regions.

IS and other extremist groups gained a foothold in Libya over the years of chaos that engulfed the North African country in the aftermath of the 2011 uprising that toppled and killed longtime dictator Moammar Gadhafi. Militias, originally made up of NATO-backed rebels, quickly filled the security vacuum

The country has been split between rival parliaments and governments, each backed by a loose array of militias and tribes. Western nations view the newly-formed UN-brokered government as the best hope for uniting the country, but Libya's parliament, which meets in the far east, has refused to accept it.

Another fight against Islamic militants is ongoing in the eastern city of Benghazi, under the command of Marshal Khalifa Hifter who answers to the parliament.

UN Envoy to Libya Martin Kolber told the UN Security Council on Tuesday, "the fight against terrorism has produced results, but the gains are not irreversible."

He also said that the fragmentation of the country's security authorities, "allow criminal and terrorist networks to flourish. Kidnappings, extortion and theft occur daily."