TRIPOLI, Libya — NATO’s triumphant, seven-month air campaign against Libya ended Monday, setting the country on the path to a democratic transition less than two weeks after the capture and killing of ousted dictator Moammar Gadhafi.

The alliance turned down a Libyan request to extend the protective umbrella for a few more weeks, apparently eager to exit on a high note and wrap up a costly mission at a time of financial austerity.

The relatively quick victory in Libya represented a boost for an alliance mired in a 10-year war in Afghanistan, a 12-year mission in Kosovo and  anti-piracy operations off the Somali coastline.

The operation’s critics – including Russia, China and the African Union – have argued that NATO misused the limited U.N. resolution imposing a no-fly zone and authorizing the protection of civilians as a pretext to promote regime change.

But with alliance airstrikes helping open the way on the battlefield after a long stalemate, revolutionary forces eventually captured Tripoli in late August and brought an end to the war with Gadhafi’s death Oct. 20.

“Together, we succeeded. Libya is finally free,” NATO chief Anders Fogh Rasmussen told a joint news conference in Tripoli with Mustafa Abdul-Jalil, Libya’s interim leader.

Addressing the Libyans, he said: “You acted to change your history and your destiny. We acted to protect you.”

In the past seven months, NATO warplanes flew 26,000 sorties, including some 9,600 strike missions, destroying more than 1,000 tanks, vehicles and guns.

U.S. planes flew a quarter of those missions, mostly in support roles such as air refueling and battlefield surveillance. The European allies and four partner nations conducted the vast majority of ground attacks.

As NATO pulled out, Libya’s leadership, the 51-member National Transitional Council, was taking another step toward a democratic system, to be operational within two years. The council chose a new prime minister, U.S.-educated electrical engineer and NTC member Abdurrahim el-Keib, who will pave the way for general elections.

El-Keib, of Tripoli, said he would appoint a new government within two weeks. The new government will oversee the drafting of a constitution.

The NTC started out as an impromptu group of anti-Gadhafi activists, but evolved into a more carefully chosen interim government after the fall of the Gadhafi regime, said Jalal el-Gallal, an NTC spokesman.

Fogh Rasmussen, the NATO chief, suggested the possibility of a future partnership with a democratic Libya. Asked about reports of unsecured arms sites in Libya, he said, “It is now primarily the responsibility of the new authorities in Libya to make sure that weapons are secured.”

Abdul-Jalil confirmed the presence of chemical weapons sites, and said foreign inspectors were arriving later this week to deal with the issue.

Libyan leaders had requested an extension of NATO protection for a few more weeks, but Libyan officials said that was turned down. NATO leaders have emphasized that although overall the campaign went very well, the conflict placed a major burden on some alliance capabilities.