By David Brunnstrom and David Alexander
BRUSSELS (Reuters) - NATO said on Thursday it expected to end its mission in Libya soon and its decision would be based on whether there was still a threat to civilians and the ability of the country's new rulers to provide security.
U.S. Defense Secretary Leon Panetta said there was "a pretty clear consensus" among NATO defense ministers, who met in Brussels to chart an end to the mission, and they would look closely at the battle for Gaddafi's home town of Sirte.
"There are some important guidelines to look at: one, what happens in Sirte. Number two, does the regime maintain the capability to attack civilians? Number three, does Gaddafi maintain any kind of command capability? Number four, what is the state of the opposition forces to be able to provide security?" he told a news conference.
NATO's top operations commander, Admiral James Stavridis, Told the briefing these were not a precise set of metrics and the decision would be a political one based on the recommendation of NATO commanders.
"It will be a confluence of all those things," he said.
NATO Secretary General Anders Fogh Rasmussen said it was clear the end of the mission, which has involved more than 9,000 air strike sorties, was in sight.
"I expect the time to end our mission will come soon," he told a news briefing. "Gaddafi's forces are fighting for a lost cause. The threat to civilians is fading away."
While NATO was determined to continue the operation as long as threats to civilians persisted, "we stand ready to terminate the mission as soon as the political and military conditions are fulfilled", he said.
Rasmussen added that the decision would be taken in coordination with the United Nations and Libya's interim rulers.
French Defense Minister Gerard Longuet, whose country has been one of the leaders of the air mission, said it would continue as long Gaddafi's forces put up resistance in their remaining holdouts and until there was "normal functioning of the state".
He said Libya's ruling National Transitional Council should also request an end to the mission.
"There should no longer be any pockets of resistance and the NTC must request it," he told reporters. "As for Gaddafi...as long as he disappears from the stage, that would be important, but not enough. The NTC wants to capture him, and one can understand that."
Longuet said the capture of Sirte would be important symbolically, but added: "It's not the whole of Libya. We still have some pro-Gaddafi resistance in Bani Walid for example and some ... movements scattered in the south of Libya."
Libyan government forces have been fighting their way street by street into Sirte and their commanders have said the battle for the city was entering its final hours [nL5E7L4483].
Taking Sirte would dispense with the biggest pocket of pro-Gaddafi resistance and allow the interim government to focus on preparations for democratic elections, but heavy sniper fire held back the advance of their forces on Thursday, making predictions of a quick end to the battle look optimistic.
NATO launched its air and sea operation after the United Nations authorized the use of limited force to protect the civilian population from fighting between forces loyal to Gaddafi and they rebels who have since overthrown him. NATO extended the mission for 90 more days in late September.
Rasmussen said NATO would be willing to help Libya's new rulers in future, but would not have a major post-war role. He said assistance could include help with security and defense reforms.
NATO officials said NATO conducted no strikes in Libya on Monday and Tuesday but hit targets, including command and control sites and troop marshalling areas near Bani Walid on Wednesday.
(Reporting By David Brunnstrom Editing by Maria Golovnina)