As Libyans in the United States cheered the death of Moammar Gadhafi, President Barack Obama on Thursday called the fate of the former Libyan leader both the end of a "long and painful chapter for the people of Libya" and the hallmark of a successful U.S. foreign policy.

In the first official government remarks on the killing of a longtime foe who was behind terrorist attacks against U.S. citizens, Obama pledged American support as Libya builds a democratic system from the ruins of dictatorship.

"You have won your revolution," he said to the Libyan people.

Obama also praised the efforts of U.S. military personnel who took part in the NATO-led military mission that launched thousands of airstrikes in support of Libya's rebel forces.

"Without putting a single U.S. service member on the ground, we achieved our objectives," Obama said in heralding a strategy that "demonstrated what collective action can achieve in the 21st century."

In an obvious reference to Syria and the crackdown on dissent by President Bashar al-Assad, Obama noted that Gadhafi's death proved "once more that the rule of an iron fist inevitably comes to an end."

"Across the Arab world, citizens have stood up to claim their rights," the president said. "Youth are delivering a powerful rebuke to dictatorship, and those leaders who try to deny human dignity will not succeed."

His statement, delivered in the White House Rose Garden, followed hours of silence by top government officials as initial reports that Gadhafi had been captured or killed emerged from Libya.

It was a very different scene hours later outside the White House, as dozens of people waved and wrapped themselves in the Libyan flag while cheering Gadhafi's death.

Many sang to the beat of a drum Thursday evening, while one celebrant held a hand-drawn sign showing a newborn baby drawn over the outline of Libya -- symbolizing a country reborn.

Secretary of State Hillary Clinton was in Afghanistan when she said "Wow" after an aide handed her a Blackberry that spoke of Gadhafi's capture. At the time, she stressed the reports were "unconfirmed" and noted similar stories had proven false,

Politicians were less reticent, especially as it became more clear that Gadhafi was in fact dead. Sens. John Kerry and John McCain, both foreign affairs veterans, were among several legislators who remarked about Gadhafi's death long before Obama issued his statement.

McCain, an Arizona Republican who lost to Obama in the 2008 presidential election, called it a "great day" and said the administration he previously criticized for withholding full U.S. military capacity in Libya "deserves great credit."

"Obviously, I had different ideas on the tactical side, but ... the world is a better place, and the Libyan people now have a chance," McCain told CNN.

Kerry, a Massachusetts Democrat, said Obama's policy of building a NATO-led coalition for the Libya mission "demonstrated clear-eyed leadership, patience and foresight by pushing the international community into action."

"Though the administration was criticized both for moving too quickly and for not moving quickly enough, it is undeniable that the NATO campaign prevented a massacre and contributed mightily to Gadhafi's undoing without deploying boots on the ground or suffering a single American fatality," Kerry said.

Rep. Mike Rogers, the chairman of the House intelligence committee, cheered the news that Gadhafi's "brutal regime is finally over." At the same time, the Michigan Republican stressed what he deemed an urgent need to secure "Libya's large stockpile of chemical and other advanced weapons" in this period of transition.

Vice President Joe Biden noted that the U.S. role in the campaign cost no more than $2 billion and that no American lives were lost, saying: "This is more a prescription about how we ought to deal going forward.

"We do not have to do it ourselves. ... The NATO alliance worked like it was designed to do," Biden told CNN's Candy Crowley in New Hampshire, calling Gadhafi "one bad guy. This was real burden sharing."

According to figures from the Pentagon and State Department, the total bill as of September 30 for the U.S. role in the Libya campaign was about $1.3 billion.

However, Republican Sen. Marco Rubio of Florida complained that Obama's strategy unnecessarily extended the conflict by withholding full U.S. involvement and firepower.

"If the U.S. had gotten involved early, aggressively and decisively, today would have happened months ago," Rubio said. "Sometimes you don't just have to do the right thing. You have to do the right thing at the right time, and I think this administration failed to do that."

The news of Gadhafi's death marked the end of the seven-month NATO-led Libya campaign initially spearheaded by the United States to prevent Gadhafi's forces from attacking Benghazi, the opposition stronghold.

NATO Secretary General Anders Fogh Rasmussen announced Thursday, hours after Gadhafi was killed, that the alliance "will terminate our mission" in the North African nation.

Clinton visited the Libyan capital of Tripoli this week, making her the highest-level U.S. government official to go to the country since 2008.

In a CNN interview in Afghanistan as the reports of Gadhafi's death were emerging, Clinton said Libya's governing National Transition Council didn't want to begin the process of forming a new government until Gadhafi was captured or killed, fearing "security problems."

While challenges remain for Libya, Clinton said that Gadhafi's absence -- meaning that he cannot marshal popular support, pay for mercenaries or lead a guerrilla warfare campaign -- would make "a big difference."

"(His death brings) a lot of legitimacy and validation and relief to the formation of the new government," she said.

The killing of Gadhafi also raises anew the question of whether a Libyan convicted of helping bomb Pan Am Flight 103 in 1988, killing 270 people, would be forced to resume serving a prison sentence in Scotland.

Abdelbeset al-Megrahi returned to a hero's welcome in Libya two years ago after his humanitarian release from a Scottish prison due to advanced cancer. He is still alive today, and some U.S. legislators have mounted a vigorous campaign for his return to prison.

House Speaker John Boehner, an Ohio Republican, said the United States can be a "willing friend and partner" to Libya's new government if it can "resolve all issues associated with Gadhafi's terrorism-sponsored activities."

To the brother of a victim of the Pan Am bombing, Gadhafi's death represents justice delayed but not denied.

Brian Flynn said that when his brother John Patrick Flynn died, "I promised him and myself that I wouldn't let it go, that there would be justice."

"Today is an example that after 22 years, finally justice is done," Flynn said. "I owed him that. And I feel that the Libyan people have helped me fulfill my promise to him, an example that we've been able to do that."