The eccentric 69-year-old, who preached a strange cocktail of ideology based on Islam and socialism, died in his hometown Sirte, apparently after being wounded in the legs.
A fighter from the National Transitional Council (NTC) told BBC that Gaddafi cried for mercy as the forces advanced menacingly. "Don't shoot," he pleaded while hiding in a hole.
There were other versions of his final moments too.
Tens of thousands of Libyans took to the streets across the country to celebrate as news of the former dictator's death spread. Gunmen fired away in the air. Motorists constantly honked while some played music.
Cries of "Allah Akbar" (God is Great) rent the air.
Gaddafi's death marked the end of a prolonged revolt that began in Benghazi in February, inspired in part by the popular uprisings in Tunisia and Egypt.
Gaddafi used strong arm methods to put down the rebellion, and it looked initially that he may succeed. But the US and other Western countries came out strongly in favour of NTC, sealing Gaddafi's fate.
From Aug 23, as the rebels seized Tripoli, Gaddafi was on the run. He kept issuing statements from hideouts.
There were conflicting versions of how he died. One account said he bled to death while being taken away to Misrata town. Other reports said he was shot in the head. Yet another version said he was slain while fleeing.
Television channels flashed images of a bloodied Gaddafi leaning against a fighter. Another picture showed him sprawled on the ground, dead.
Gaddafi died of his wounds, a NTC field commander told Xinhua.
The commander, Mohemmed Buras Ali Al-Maknee, had earlier claimed that fighters from the western Libyan city of Misrata had captured a severely wounded Gaddafi.
The former leader had been injured in both his legs at Sirte, the last major outpost of pro-Gaddafi forces who were slowly encircled by thousands of advancing NTC fighters, media reports said.
Al-Jazeera TV quoted Abdel Hakim Belhaj, NTC's military chief in Tripoli, as confirming that Gaddafi was dead.
Al-Jazeera also reported that Gaddafi's fourth son Mutassim was captured in Sirte, several hours after his father was killed.
TV footage showed a body stated to be that of Gaddafi's feared defense minister Abu Bakr Younus.
The fall of Sirte and Gaddafi marked the end of another major chapter in the Arab world which has seen unprecedented upheavals in recent times that have led to regime change in Egypt and Tunisia.
Yemen, Algeria, Syria and Bahrain have also seen mass protests against their rulers.
Gaddafi was one of the world's longest rulers, having seized power in a bloodless coup in September 1969 against King Idris. He was 27 years old then.
He married twice and had seven sons and a daughter.
Gaddafi later turned Libya into a hub for revolutionaries, angering the US, which was also piqued with his pro-Soviet leaning.
Along with Syria, South Yemen, Algeria and PLO, Libya became a member of the "Arab Steadfastness Front" in the 70s and 80s that advocated Israel's destruction.
According to scholars, Gaddafi, who often dressed like a bedouin and surrounded himself with female bodyguards, sought to transform Libya with its vast energy reserves.
But the country of 6.5 million people faced international isolation following the bombing of a Pan Am flight 103 over Lockerbie in Scotland in 1988 that killed 258 people.
US President Ronald Reagan ordered air strikes on Gaddafi in 1986 but he survived.
On June 27 this year, the International Criminal Court issued arrest warrants against Gaddafi, his son Saif al-Islam and his intelligence chief Abdullah al-Senussi on charges of crimes against humanity.