Moammar Gadhafi was the longest surviving dictator in the Arab world -- one of the longest surviving leaders anywhere -- and the only leader that most Libyans have ever known.

He ruled Libya for 42 years, and while his grip on power slipped months ago, for many in Libya, his death will mean both a new beginning and an uncertainly they've never known before.

As with so many dictatorships, Gadhafi's was one that began with hope and optimism.

He first appeared as a charismatic man of the desert, the son of illiterate Bedouins who rose to become a colonel in the military. In 1969, at the age of 27, he helped stage a bloodless coup that toppled King Idris, easing himself into power.

In his early years as leader, Gadhafi began to invest the country's oil wealth into education, reconstruction, in nationalizing the country's businesses. But he also had plans to merge together much of the Arab world, with him as president. He tried to bring together Libya, Egypt and Syria into an Arab federation, but it was without success.

Like so many dictators, Gadhafi held a deep fear of being overthrown and criminalized all political parties, sharing power only with his family members and closest associates. Over the years, his critics were imprisoned, tortured and often killed. Those who tried to mount coups against him were executed, hanged in city squares.

International security expert Eric Margolis says right from the start, Gadhafi had grandiose ideas about himself and his role in Libya.

"He called himself the ‘Brother Guide of Libya'," Margolis told CTV's Canada AM this week.

"He wasn't your average dictator; he had some special messianic qualities that made him different. He felt he was answering a higher voice or a higher mission. He declared himself the embodiment of the Libyan people."

On foreign trips, Gadhafi brought along a Bedouin tent where he conducted meetings, and was often accompanied by armed female bodyguards because he believed they were less easily distracted than men. He dressed flamboyantly, alternating between gilded military outfits, robes and for a time, the latest Western fashion.

But few took him as seriously as he took himself. To some, he seemed little more than a buffoon, an oddball with an ego.

The western world began to recognize Gadhafi as a terrorist through the 1980s, when he was sending out assassination teams to murder Libyan exiles, and bankrolling terror groups that bombed European capitals and brought down civilian aircraft. His military was developing chemical, biological and nuclear weapons. He was becoming a threat to the region and beyond.

By 1986, the United States had enough and tried to have him killed, sending cruise missiles crashing into his Tripoli compound. After 270 people were killed in the bombing of Pan Am jet over Lockerbie, Scotland, Libya was finally put under United Nations sanctions. Though it wouldn't be until 2003 that Libya would take responsibility for the bombing, for many in the West, there had never been any doubt.

Gadhafi was no longer the clown, but the "mad dog" of the Middle East, as former U.S. president Ronald Reagan so famously dubbed him. As CTV's Tom Kennedy notes, Gadhafi probably didn't mind the nickname. But he very much minded becoming an international pariah, even in much of the Arab world. Isolation did not sit well with his self-perception of greatness.

After the U.S. invaded Iraq and captured Saddam Hussein in 2003, Gadhafi seemed to become worried that a similar fate could befall him. So he began a spectacular turnaround to insist he was not a terrorist and to try to normalize relations with the West.

He renounced weapons of mass destruction and forged ties with western leaders like former British prime minister Tony Blair. He agreed to pay up to $10 million to relatives of each victim of the 1988 Lockerbie bombing.

The UN and the U.S. lifted sanctions against his country. But for Libyans, little had changed, and disgruntlement against his rule was as fierce as ever. For more than 40 years, they'd been living with harsh dictatorship and Gadhafi family corruption. For them, reconciliation with the West changed nothing.

Following the lead of Tunisia and Egypt, Libyans started an uprising in February, 2011 calling for Gadhafi's resignation. He refused to step down, choosing instead to go into hiding after rebels drove triumphantly into the capital of Tripoli in late August.

"I am a fighter, a revolutionary from tents ...I will die as a martyr at the end," he proclaimed in one of his last televised speeches.

He vowed that he would never leave Libya and leave he never did. His death at age 69 came as Libyan fighters defeated Gadhafi's forces in his hometown of Sirte, the country's last major site of resistance.

With a report from CTV's Tom Kennedy