NATO is to formally decide on Wednesday whether to end its mission over Libya now that Muammar Gaddafi is dead and buried and the country's new leaders have declared the nation liberated.

The likely decision to end the alliance's patrols over the skies of Libya at the end of the month marks another milestone in what the National Transitional Council (NTC) has pledged will be a road towards democracy and free and fair elections in 2013.

But the deaths of Gaddafi and his son Mo'tassim after both were captured wounded but alive on Thursday and the grisly public display of their decomposing bodies in a Misrata meat locker have made the NTC's Western backers uneasy about Libya's prospects for stable government and respect for the rule of law.

Gaddafi and Mo'tassim were buried in a secret desert location on Tuesday to prevent their graves becoming a shrine for any remaining followers in the oil-rich North African state.

Under pressure from Western allies, the NTC promised on Monday to investigate how Gaddafi and his son were killed. Mobile phone footage shows both alive after their capture. The former leader was seen being mocked, beaten and abused before he died, in what NTC officials say was crossfire.

The treatment of others who supported Gaddafi and fought alongside him was now an issue, said U.S. Assistant Secretary of State for Near Eastern Affairs Jeffrey Feltman.

This is a test. The NTC has repeatedly said that they will distinguish themselves from the Gaddafi regime in terms of the respect of human rights and the rule of law, he told a news conference in Morocco.

Now is the time for them to begin actions that will help them reinforce these words.

RIVALRIES

Emerging from 42 years of often brutal one-man rule, many Libyans are savouring the end of eight months of bitter civil war won with NATO's backing and are unconcerned about how Gaddafi met his end and how his body was treated afterwards.

Throw him in a hole, in the sea, in garbage. No matter. He is lower than a donkey or a dog and only foreigners say they care about how we killed him. And they are lying, said engineer Ali Azzarog, 47.

Hatred of Gaddafi unified his disparate opponents, who will likely now tussle for power during a planned transition to democracy in a nation riven with regional and tribal rivalries.

With economic problems at home, NATO countries are expected to endorse an end to their U.N.-mandated mission in Libya when their ambassadors meet in Brussels on Wednesday after a preliminary decision last week to end it on October 31.

We said that we would consult closely with the United Nations and the NTC and that process of consultations is ongoing, NATO spokeswoman Oana Lungescu said.

Libyan interim Oil and Finance Minister Ali Tarhouni said he wanted NATO to maintain its mission for another month, but hoped for a swift end to United Nations sanctions to free up funds for the interim government to pay salaries and help reconstruction.

SAIF ON THE RUN

NATO spokeswoman Lungescu declined to say whether NATO might extend the mission.

I don't know whether there is a formal request. All these things remain to be sorted out. But in the end this is a political decision, she said.

NATO's Deputy Assistant Secretary General for Political Affairs and Security Policy, James Appathurai, said he expected the alliance to confirm its decision to end the mission.

I don't expect that there will be a change to that decision, because it is quite clear that the pro-Gaddafi elements no longer have the command and control or other capabilities to pose an organised threat to civilians. That is now finished, and as a result our operation will end, he said.

Western military powers have already begun winding down the Libyan mission, and diplomats have said the majority of NATO equipment, including fighter jets, has already been withdrawn.

A NATO statement on Tuesday said operations in the interim would involve intelligence, surveillance and reconnaissance missions, although NATO would retain the capability to conduct air strikes if they were needed.

The one remaining element from the old order is Gaddafi's sons, the enigmatic Saif al-Islam, who remains on the run. Once viewed as a moderate reformer, he vowed to help his father crush his enemies once the revolt began.

An NTC official said Saif al-Islam was in the southern desert near Niger and Algeria and was set to flee Libya using a false passport.

(Reporting by Taha Zargoun in Sirte, Barry Malone and Jessica Donati in Tripoli, Rania El Gamal and Tim Gaynor in Misrata, Christian Lowe, Jon Hemming and Andrew Hammond in Tunis, Hamid Ould Ahmed in Algiers, Samia Nakhoul in Dubai, Abdoulaye Massalaatchi in Niamey, Matt Falloon in London, Souhail Karam in Rabat; Writing by Jon Hemming; Editing by David Stamp and Ralph Gowling)