Colonel Muammar Gaddafi, leader of Libya from 1969 to 2011, has been killed after an assault on his home town of Sirte, officials from the country's transitional authority have said.
Ian Jones assesses a ruler who raged against the rest of the world but who was brought down by his own people.
Colonel Gaddafi ended his life branded with the same words that had followed him through most of his military and political career: thug, terrorist, and murderer.
During the tumultuous days in late August 2011 when rebel forces saw their six-month campaign to topple Gaddafi reach a bloody yet successful conclusion on the streets of Tripoli, the Libyan leader was called "a criminal" by President Sarkozy of France; "a dictator" by David Cameron, the UK prime minister; and "a tyrant" by Barack Obama, the US president.
Yet the former soldier, who ruled Libya from 1969 to 2011 and who became the longest-serving Arab leader for over 100 years, was not always viewed with such universal disdain.
In March 2004, Tony Blair, the UK prime minister at the time, visited Colonel Gaddafi in Tripoli. Mr Blair praised Gaddafi for his desire to form "common cause with us against al-Qaeda, extremists and terrorism," and for the Libyan leader's recent renunciation of weapons of mass destruction.
Two years later the country was removed from the United States' list of countries sponsoring terrorism, on the approval of President George W Bush. And as late as June 2009, Mr Blair's successor as prime minister, Gordon Brown, socialised with Gaddafi during a G8 summit in Italy, speaking of his "admiration and gratitude" for the colonel's "brave" decision over his weapons programme.
Such niceties were quickly and quietly forgotten when, in February 2011, Gaddafi's regime began a brutal crackdown on anti-government protests. Within weeks the United Nations had authorised a no-fly zone over the country and passed a resolution allowing "all necessary measures" to be taken to protect Libyan civilians. The first strikes by US, French and British warplanes on pro-Gaddafi forces took place on 19 March.
However throughout his life, whether playing the part of friend or foe, ally or enemy, Colonel Gaddafi consistently relied upon one towering attribute, which had first won him power and then enabled him to retain it for so many decades: his personality.
The road to revolution
Muammar Muhammad al-Gaddafi was born in the Libyan coastal city of Sirte in June 1942 to a family belonging to a small Arab tribe, the Qadhadhfa. He was raised in a bedouin tent in the nearby desert, before attending a Muslim elementary school and receiving secondary school education from a private tutor in Misrata.
He had displayed a keen interest in history and politics from an early age, and it was in Misrata that a brash and vocal anti-Israeli, anti-western outlook, one that would become a trademark characteristic, first took root. Keen to express such sentiments in actions as well as arguments, Gaddafi joined the Libyan military academy at Benghazi in 1961, graduating four years later.
While at military college, Gaddafi's radical politics and martial tendencies fused into a desire to help ferment, if not lead, an Arab revolution in Libya. He was deeply inspired by the strident nationalism of Egyptian president Gamal Abdel Nasser. The forcefulness of Gaddafi's now potent personality was an inspiration to his fellow students. Together they began plotting to overthrow the Libyan monarchy.
The plan was put into action on 1 September 1969 - and it was a complete success. A small group of junior officers, led by Gaddafi (aged just 27), staged a bloodless coup while the king was in Turkey for medical treatment. The monarchy was abolished and the country was proclaimed the Libyan Arab Republic.
So began Gaddafi's 42 years in charge of the fourth largest country in Africa, and the 17th largest country in the world.
A new Libya
Intolerance and brutality were present from the outset. Libya's entire Italian population, a legacy from colonial times, was expelled; political dissent was made illegal; and all forms of Christianity, including the calendar, were either abolished or replaced (the year of the coup, 1969, being formally retitled 1389, dated from the birth of the prophet Muhammad).
In 1977 the country was rebranded the Great Socialist People's Libyan Arab Jamahiriya, the last word being commonly translated as "state of the masses". Yet Libya was anything but a socialist paradise. Citizens were encouraged to spy on and shop each other. Up to one in five Libyans worked as informants. The press was censored. State-sponsored assassination became common, both internally and externally, with "hit squads" being deployed to murder Libyan dissidents living abroad. As recently as 2004, Gaddafi offered a million dollars for the death of Ashur Shamis, a journalist who had been living in Britain since the 1960s.
Such repressive machinery was kept in place by multiple layers of security forces in thrall to Gaddafi's now fully developed cult of personality. Identified formally as "Brother Leader and Guide of the Revolution", his image was reproduced everywhere: on posters, statues and flags, on stamps and currency, in textbooks and newspapers, and on the state television network. Gaddafi's philosophy - an autocratic mix of capitalism and communism - was promoted and popularised in The Green Book, first published in 1975 and required reading for all schoolchildren.
Yet he did bring prosperity to much of his country, if not all of his people. With the 10th largest oil reserves on the planet at his disposal, Gaddafi's Libya had the potential to become very rich very quickly.
Some areas of Libya saw immense investment. Gaddafi's principles were flexible enough to welcome many workers and industrialists from western nations, so long as they brought expertise that could benefit his country's infrastructure. Millions were spent over a period of almost 25 years in building a spectacular trans-Sahara water pipeline, named the Great Man-Made River project, in order to end water shortages among areas of rising population. And the CIA's World Factbook of 2009 showed the average life expectancy of a Libyan to be 77 years: only one year less than that of an American citizen, a statistic atypical for the African continent.
But areas away from oil-fields and the rich coastal towns were scarred by long-term unemployment. And from the mid-70s onwards it was increasingly the case that much of the country's income from oil was spent on purchasing arms and sponsoring dozens of paramilitary and terrorist groups around the world, including the IRA.
It was this activity that began to bring Gaddafi into repeated clashes with other countries, particularly those of the west.
Sponsor of terrorism
In 1976 Gaddafi bragged openly of his links with the IRA, and talked of "the bombs of Libyan people" exploding on British streets. Relations between the UK and Libya deteriorated. Worse was to come in 1984, when Libyan diplomats inside the country's embassy in London fired on demonstrators outside. A British policewoman, Yvonne Fletcher, was killed. Diplomatic relations were broken off; WPC Fletcher's killer has never been identified.
In 1986 the US bombed Libya in retaliation for the planting of a bomb at a nightclub in West Berlin that killed three and injured 229. Air strikes were launched from US bases in the UK, prompting Gaddafi to step up his financing of the IRA. Then in December 1988, a plane flying from London to New York was blown up over the village of Lockerbie in the south-west of Scotland. A total of 270 people were killed, including all 259 people on board.
Two Libyan agents were later indicted for the crime, and it was Gaddafi's decision to hand over the suspects to a Scottish court sitting in the Netherlands that led to the United Nations suspending sanctions against Libya in 2001.
So began the period of reconciliation between Libya and the west. Gaddafi's motives were, once again, shaped by his personality. He passed intelligence on Islamic extremists to MI6 and the CIA, as much out of a fear for his own life and status (he was nearly assassinated in 1996) as on moral grounds.
Within days of Saddam Hussein being overthrown in 2003, Gaddafi outed himself as an owner of weapons of mass destruction, stealing a march on his critics and winning plaudits from unlikely sources. Tony Blair was soon beating a path to Gaddafi's tent. In June 2010, Gaddafi sat just two places away from President Obama at a dinner at the G8 summit in Rome.
Uprising and downfall
All these gestures of rapprochement came to an abrupt, violent halt in February 2011.
Inspired by anti-government protests across the Middle East and north Africa, pro-democracy demonstrators staged uprisings in towns and cities across Libya. Within days, rebel forces had seized control of Benghazi, the country's second city.
A civil war began as troops loyal to Gaddafi fought back, initially very successfully, until Nato air strikes enabled the rebels to counterattack and begin a slow but steady advance towards Tripoli. For his actions in waging war on his own people, the International Criminal Court issued an arrest warrant for Gaddafi on the grounds of crimes against humanity.
Gaddafi remained defiant to the last. Early in the campaign he vowed "we will fight until the last man and last woman to defend Libya". He stayed in Tripoli even when it was clear the city was about to fall to rebel forces. After fleeing his compound on 23 August, he broadcast a message pledging "martyrdom or victory". The same force of personality and self-belief that had propelled him to power and then helped him maintain rule for over four decades was evident in his final words.
Gaddafi was killed after an assault on his home town of Sirte on 20 October 2011. He reportedly died from wounds in his head and legs. It was unclear whether he was hit in a Nato air strike on a convoy fleeing Sirte, a firefight on the ground, or in concrete tunnels within the town itself.
Muammar Gaddafi was married twice, and had eight biological children, seven of them sons. His second wife Safiya Gaddafi and daughter Aisha were believed to have fled into Tunisia in May 2011.