TRIPOLI, Libya — With armed loyalists of Col. Muammar el-Qaddafi, the fallen Libyan leader, still ensconced in his hometown and a few other redoubts as the seven-month-old Libyan conflict winds down, NATO announced a three-month extension of its bombing campaign on Wednesday.

“We are determined to continue our mission for as long as necessary, but ready to terminate the operation as soon as possible,” the NATO secretary general, Anders Fogh Rasmussen, said in a statement from the alliance’s Brussels headquarters.

It is the second 90-day extension, and it was approved less than a week before the campaign was set to end.

NATO’s aerial campaign in Libya, authorized under a United Nations Security Council mandate to protect civilians from Colonel Qaddafi’s military reprisals, effectively became a major weapon of the rebels who toppled him last month. The Transitional National Council, the interim government of anti-Qaddafi forces that have taken control in much of Libya, has expressed gratitude to NATO for its role.