Five years ago he made headlines when he agreed to surrender the two Libyan suspects in the 1988 bombing of an American jumbo jet over Lockerbie in southern Scotland in which 270 people died.
He aimed to free his country from international sanctions despite the risks involved.
One of al-Qadhafi's concerns was that the trial of the two suspects could put the spotlight on Libya's past role in advancing the revolutionary agenda he has advocated.
In the trial by a Scottish court sitting in the Netherlands, one suspect was acquitted and the other received a mandatory life sentence, being served in a Scottish prison. Libya subsequently agreed to compensate families of the Lockerbie victims.
The UN Security Council voted unanimously last September to lift sanctions against Libya, although Washington kept its sanctions in place.
Self-appointed defender of the Arab nation, al-Qadhafi was for years reviled by the United States and some of its allies as an evil force behind international terrorism.
The colonel, known at home as the Leader of the Great Revolution, has long denied charges that he has bankrolled hijacks, assassinations and revolutions, while insisting on his
right to support national liberation movements.
Diplomats said UN sanctions imposed in 1992 after the plane bombing had crippled oil-rich Libya's economy, dampened al-Qadhafi's revolutionary spirit and taken the sting out of his anti-capitalist, anti-Western rhetoric.
Qadhafi took power in a bloodless military coup in 1969
They had also tarnished his image in the eyes of a people increasingly fed up with their country's isolation.
Accusations that al-Qadhafi sent agents to blow up a Berlin club frequented by US Marines in 1986 led to US air raids on Tripoli and Benghazi days later. Qadhafi's home in the Aziziya barracks was hit and his adopted daughter killed.
Soldier turned politician
Al-Qadhafi took power in a bloodless military coup in 1969 and oversaw the rapid development of his poverty-stricken country, previously known for little more than oil wells and deserts where huge tank battles took place in World War Two.
One of his first tasks was to build up the armed forces, but he also spent billions of dollars of oil income on improving living standards, making him popular with the poor.
Al-Qadhafi has poured money into giant projects such as a steel plant in the town of Misrata and the Great Man-Made River, a scheme to pipe water from desert wells to coastal communities.
Al-Qadhafi has looked increasingly to
Africa as he has lost faith in Arabs
He has used tough tactics against dissidents, who include Islamists, and has used "purification committees" of army and police officers, joined by loyal students, to keep control.
Visionary or dictator, Al-Qadhafi's quirky style is unique.
He lives in a run-down army barracks in Tripoli or camps Bedouin-style, often taking his tent with him on trips abroad. He once pitched it inside Cairo's presidential compound.
Ignoring the traditions of his conservative society, he surrounds himself with women bodyguards toting assault rifles.
Swings in al-Qadhafi's foreign policy have often taken friends and foes by surprise.
He backed non-Arab Iran in its 1980-88 war with Iraq because of perceived US support for Baghdad in that conflict.
A fierce opponent of Israel and of Arabs willing to make peace with it, he expelled thousands of Palestinians living in Libya in 1995, saying they should go "home" to territory in the Gaza Strip and West Bank handed to the Palestinian Authority.
He embarrassed former Turkish Prime Minister Necmettin Erbakan on a 1996 visit to Libya by advocating a Kurdish state.
A fierce opponent of Israel and of Arabs willing to make peace with it, he expelled thousands of Palestinians..
Al-Qadhafi, an admirer of the Arab nationalist ideas of Egypt's late leader Gamal Abdul Nasser, has attacked Arab rulers for courting the West and not sharing their countries' resources.
Born in 1942 in the Sirte coastal area to nomadic parents, al-Qadhafi went to school at Sebha, then to Benghazi University to study geography, but dropped out to join the army.
In September 1969 he and a few junior officers toppled King Idris and in the 1970s he formulated his "Third Universal Theory," a middle road between communism and capitalism.
In 1977 he changed the country's name to the Great Socialist Popular Libyan Arab Jamhuriya (State of the Masses) and gave people the right to air their views at "people's congresses."