NATO has formally announced the end of its military mission in Libya following a meeting of ambassadors from the alliance's 28 states in Brussels.
Friday's decision comes a day after the 15-nation United Nations Security Council unanimously voted to end the mandate that had authorised military action in Libya.
Alliance warplanes will cease operations on Monday after flying more than 26,000 sorties, and bombing almost 6,000 targets, in a seven-month operation that helped bring about the overthrow of Muammar Gaddafi, the former Libyan leader.
"We have fully complied with the historic mandate of the United Nations to protect the people of Libya, to enforce the no-fly zone and the arms embargo," Anders Fogh Rasmussen, NATO's secretary-general, said in a statement.
"Operation Unified Protector is one of the most successful in NATO history, We are concluding it in a considered and controlled manner because our military job is now done."
The mandate of Unified Protector, the name of NATO's operation, was to protect civilians and civilian-populated areas under attack or threat of attack.
The alliance's operations in Libya had divided the UN, with Russia, China, Brazil, India and South Africa accusing the alliance of breaching the Security Council mandate.
Between now and Monday, NATO aircraft will continue to monitor the situation on the ground and, if needed, "respond to threats to civilians", Rasmussen said.
NATO decided to end the mission even though interim Libyan leader Mustafa Abdel Jalil asked for the alliance to stay until the end of the year, warning on Wednesday that Gaddafi loyalists still posed a threat.
Jalil's fears were heightened by reports that Gaddafi's former intelligence chief Abdullah al-Senussi, who fled Libya, had passed from Niger into Mali.
It was not known if Gaddafi's son Saif al-Islam was with him. Saif was earlier reported to be hiding in Niger after his father's death.
Al Jazeera's Hashem Ahelbara, reporting from Tripoli, said Libya's new administration may seek international help in certain security matters, including the control of its borders.
"Libya has been asking about striking a new deal with NATO or with other allies such as Qatar and the UAE [United Arab Emirates] to help them build a new army and police force," Ahelbara said.
NATO officials said members of the alliance were free to give further security aid to Libya individually.
Officials pointed to comments from Qatar's top general, who said on Wednesday that Western countries had proposed setting up a new alliance headed by Qatar to support Libya after NATO ends its mission.
Thursday's UN resolution does not lift the arms embargo or other UN sanctions on Libya that have been in place for half a year.
The resolution made clear that weapons were still a problem, voicing "concern at the proliferation of arms in Libya and its potential impact on regional peace and security".
A coalition led by the US, France and Britain launched the first salvos in the air war on March 19, before handing over command of the mission to NATO on March 31.
NATO allies have hailed the mission a success, with no casualties on their side and few civilian deaths, but cash-strapped governments have been eager to bring their planes home and focus on the bigger war in Afghanistan.