(CNN) -- Libyans cheered the fate of ousted dictator Moammar Gadhafi into the early hours of Friday after his death in what Libya's transitional prime minister described as a crossfire that followed his arrest by revolutionary forces.
"This is a time to start a new Libya, with a new economy, with a new education and with a new health system -- with one future," Mahmoud Jibril, Libya's transitional prime minister, said after proclaiming Gadhafi's death.
Gadhafi was captured alive and unharmed as troops from the National Transitional Council overran his hometown of Sirte on Thursday, Jibril said. But a gunbattle erupted between transitional council fighters and Gadhafi's supporters as his captors attempted to load him into a vehicle, Jibril said, leaving Gadhafi with a wound to his right arm.
More shooting erupted as the vehicle drove away, and Gadhafi -- who ruled Libya for nearly 42 years before rebel forces overthrew him in August -- was hit in the head, Jibril said, Gadhafi died moments before arriving at a hospital in Misrata, Jibril said, citing the city's coroner.
Grainy video broadcast on Arabic satellite networks captured some of the onetime Libyan strongman's last moments, as the bloodied but still-alive Gadhafi was being hauled onto a truck. Another video showed a dead Gadhafi with what appeared to be a head wound.
According to Ali Aujali, Libya's ambassador to the United States, troops found Gadhafi in a large drainage pipe. Daily Telegraph reporter Ben Farmer in Sirte old CNN's Anderson Cooper the pipe is about 3 feet wide and filled with trash and sand.
The phrases "The place of the rat Gadhafi" and "You scum" were painted around its exterior, apparently after the capture.
Jibril said Gadhafi was carrying a gun but did not resist his captors. Jibril said DNA samples confirmed Gadhafi's identity, and the International Criminal Court -- which had issued an arrest warrant for the ousted dictator on war-crimes charges -- has agreed to allow Gadhafi's burial.
Aujali said the National Transitional Council and the Libyan people wanted Gadhafi to be taken alive to answer for his crimes. In one video from the scene, a voice can be heard shouting, "No, no, we want him alive, we want him alive."
U.S., NATO and French officials said transitional government fighters captured Gadhafi's convoy after French warplanes and a U.S. drone forced it to a halt on the way out of Sirte. Following Gadhafi's death, NATO Secretary-General Anders Fogh Rasmussen announced Thursday that the alliance "will terminate our mission," launched in March under a U.N. mandate to protect civilians.
Amnesty International called for the National Transitional Council to mount "a full, independent and impartial inquiry" into Gadhafi's death and said his inner circle and family should be "treated humanely and, if captured, given fair trials."
Abubaker Saad, who was a Gadhafi aide for nine years, said it didn't really matter whether Gadhafi was dead or alive as long as he was no longer a fugitive.
"As long as he was on the run, he represented a very ominous danger to the Libyan people," Saad said. "He represented a very ominous danger ... to the idea of the democracy in Libya."
The streets of Tripoli echoed with celebratory gunfire, car horns and cheers as crowds ran or danced through the streets. Celebrations extended into early Friday in Tripoli and Misrata, where crowds waved flags in the city's main square long after midnight.
On the surrounding roads, drivers leaned on their horns and came to brake-squealing stops as bands of revelers darted in and out of traffic.
"A black era has come to an end forever," the Libyan ambassador to Britain, Mahmoud Al Nacoua, said in London.
National Transitional Council Chairman Mustafa Abdul Jalil will officially announce on Saturday Libya's liberation, media committee member Mohamed Elkish told CNN on Thursday. Council officials have said after such a declaration a new government would soon be announced and the democratic transition would begin.
Gadhafi's killing caps a revolt that began in February and left him a fugitive for the past two months. The mercurial former army officer, who seized power in a 1969 coup, was the third Arab leader ousted in the Arab Spring upheavals that began in neighboring Tunisia in January.
Also killed Thursday were Gadhafi's son Motassim and his chief of intelligence, Abdullah al-Senussi, said Anees al-Sharif, a spokesman for the National Transitional Council's military arm in Tripoli. Other reports say al-Senussi was captured. Jibril said Gadhafi's defense minister, Gen. Abu Baker Younes, also died.
Fawaz Gerges, a professor of Middle Eastern politics at the London School of Economics, said Libyans still face a difficult political struggle. But, he added, "We should not underestimate the significance of this day."
"Gadhafi was the head of the state, the most important symbol of the country. He repeatedly tried to rally his supporters to fight on," Gerges said. "I hope that this particular day will not just mean the end of an era, but basically represent the beginning of a new era."
Gerges said the recent fighting around Sirte and another holdout of pro-Gadhafi loyalists, Bani Walid, exposed "some major tribal and regional cleavages" that Libyans will have to bridge in forming a new government. Those differences "could easily escalate, given the extent and the intensity of differences in Libya."
But he said Gadhafi's death sends a signal to other strongmen in the region: "If you oppress your people, if you don't engage your civil society, if you stay in power for so many years, this will be your end."
Fran Townsend, CNN national security contributor, said the transitional leadership "faces very serious challenges," citing groups outside Libya's borders, including al Qaeda in the Islamic Maghreb, as well as internal strife among the country's tribes.
"There will be those around them who seek to take advantage," Townsend said. "There will be tribal differences, there will be Gadhafi loyalists who melt into the population and attempt to launch an insurgency like what we saw in Iraq."
Prince Idris Al-Senussi, whose family was overthrown by Gadhafi 42 years ago, told CNN, "I feel now that finally I can go back to a free country. A country that I have loved ... and I feel proud that the Libyan people have done it themselves."
The confirmation of Gadhafi's death came after hours of conflicting reports on the deposed leader's status. When those reports first reached U.S. Secretary of State Hillary Clinton during a visit to Afghanistan, she reacted with one word: "Wow."
Clinton said the end of Gadhafi would "add legitimacy and relief to the formation of a new government."
In a brief address from the White House, President Barack Obama praised Libyans for lifting "the dark shadow of tyranny" with the aid of Western air power.
"One year ago, the notion of a free Libya seemed impossible," Obama said. "But then the Libyan people rose up and demanded their rights. And when Gadhafi and his forces started going city to city, town by town, to brutalize men, women and children, the world refused to stand idly by."
NATO, spearheaded by Britain and France, backed up the revolt by bombarding pro-Gadhafi forces. In a statement from his office, French President Nicolas Sarkozy said Gadhafi's ouster marks the start of "a new era ... one of reconciliation in unity and freedom."
British Prime Minister David Cameron said Thursday "is a day to remember all of Colonel Gadhafi's victims," including the 270 dead in the bombing of a Pan Am flight over Lockerbie, Scotland, in 1988 and "the many, many Libyans who died at the hands of this brutal dictator and his regime."
Other world leaders sounded encouragement for a new Libya, but cautioned that the road ahead won't be easy.
"In the coming days, we will witness scenes of celebration, as well as grief for those who lost so much," U.N. Secretary-General Ban Ki-moon said. "Yet let us recognize, immediately, that this is only the end of the beginning. The road ahead for Libya and its people will be difficult and full of challenges."
CNN's Dan Rivers, Mohammed Tawfeeq and Ingrid Formanek reported from Tripoli, Libya; Chris Lawrence and Barbara Starr reported from Washington; Elise Labott reported from Kabul, Afghanistan; and Nima ElBagir reported from London.