For four decades the wilful, mercurial figure of Colonel Muammar Gaddafi has been a thorn in the side of the West.
Branded "mad dog" by Ronald Reagan, the outlandish antics, flamboyant dress and bombastic pronouncements of the self-styled "Brother Leader" at times made him seem a figure of ridicule.
During his travels abroad he was accompanied by a blonde Ukrainian nurse and insisted on staying in his Bedouin tent, protected by his team of glamorous, gun-toting female bodyguards.
When he was interviewed by the BBC's John Simpson, he noisily broke wind throughout their encounter.
However, he has also been associated with some of the most notorious terrorist atrocities of the pre-9/11 era.
He shipped arms to the IRA during the Troubles and his regime has accepted responsibility for the Lockerbie bombing.
At home in Libya he ruthlessly crushed dissent against his autocratic rule while his agents hunted down and killed opponents abroad.
But for all the outrage over his flouting of international norms, he was also seen by diplomats as a wily political operator, proving to be one of the great survivors in a turbulent region.
Through assassination attempts, sanctions, and US airstrikes, he doggedly clung to power.
He was born in the desert in 1942. At the age of 27, Gaddafi was the leader of a small group of junior army officers who in September 1969 staged a bloodless coup, overthrowing King Idris while he was abroad receiving medical treatment.
Fiercely anti-western and inspired by Egypt's President Nasser, he governed according to his unique political philosophy -- set out in his Green Book -- based on a combination of socialism and Arab nationalism.
He quickly showed he would brook no dissent to his idiosyncratic rule, reportedly having students who marched against his regime publicly hanged. According to dissidents, 1,200 prisoners in one jail were executed in just three hours.
Abroad, his outspoken public support for a range of terrorist organisations, including the IRA and the Palestine Liberation Organisation, attracted growing international criticism and concern.
The increasingly erratic nature of his regime was underlined in 1984 when diplomats at the Libyan embassy in London opened fire on a demonstration outside, killing WPC Yvonne Fletcher.
In 1986, the bombing by Libyan agents of a Berlin nightclub, in which two off-duty American servicemen died, prompted President Reagan to launch airstrikes on Tripoli and Benghazi. Gaddafi's adopted daughter was among 35 Libyans killed in the raid.
Two years later, on December 21 1988, came the most notorious incident of all -- the bombing of Pan Am Flight 103 over the Scottish village of Lockerbie, killing 270 people. The attack prompted worldwide outrage. For years Gaddafi denied any involvement, leading to sanctions by the United Nations and international pariah status for his regime.
He finally began to emerge from the cold when South African President Nelson Mandela helped to broker a deal which saw two Libyan intelligence officers handed over in 1999 to stand trial before a Scottish court sitting in the Netherlands.
In 2003, the Libyan government wrote to the UN Security Council formally accepting responsibility for the actions of its officials in respect of the attacks.