TRIPOLI // For Tripoli residents, the legacy of Colonel Muammar Qaddafi is embodied in the city's architecture: a Mediterranean jewel defaced by four decades of dictatorship and mismanagement.
"Before , Tripoli was better than Italy: clean, lovely smells, nice people," says Saad El Margheni, a cafe owner who grew up in the city. "At first we trusted Qaddafi, but every day we saw more that his was a bad revolution."
Tripoli began life as Uiat, a Phoenician settlement founded beside a gentle indent in the coast. Called Oea by the Romans, the city became Tripolis - "three cities" - as it dominated nearby Leptis Magna and Sabratha.
Tripoli later passed through Vandal, Byzantine, Arab, Spanish and Ottoman hands before Italian colonialism in Libya, which ended in 1951.
In 1969, an English oil company librarian named Philip Ward published Tripoli: Portrait of a City, a guide to Tripoli for visitors. That timing made Ward's book a snapshot of the city's final months before Col Qaddafi took power that year and wrenched it on to a new course.
Hidden in the old city were stately homes of pink marble, glazed tile and plaster carved in patterns of dazzling intricacy, Ward wrote. Libyan shops rubbed shoulders with Italian groceries, Indian merchants and foreign oil companies' offices.
Foreigners and upwardly-mobile Libyans congregated in the suburb of Giorgimpopoli, shopping at "Uncle Sam Stores" and "House of Glamour Perfumery Mary Quant".
In 1960s Tripoli, "an imaginative internationalism has found a home to proclaim itself", wrote Ward.
However, trouble was brewing in the form of a 27-year-old army captain named Muammar Qaddafi. Inspired by the pan-Arabism of the Egyptian president Gamal Abdel Nasser, Qaddafi, then a captain, vowed to rid Libya of foreign influence.
On September 1, 1969, army tanks converged on Tripoli. The pro-western government of King Idris collapsed within hours. Capt Qaddafi and his fellow officers proclaimed a revolution for "freedom, unity and socialism".
"Until 1975 I trusted them," says Mr El Margheni. "Then I heard that they had killed people."
A system of committees was instituted to run Libya with Col Qaddafi as "Brother Leader and Guide of the Revolution." Foreign companies were expelled, industries nationalised and dissidents hanged in public, while Tripoli got a revolutionary makeover.
December 24th Street became September 1st Street, and some churches were converted to other uses.
The former Catholic cathedral is today a mosque, its campanile a minaret and its ribbed Gothic dome replaced with a fluted half-sphere. The romanesque Sanctuary of the Madonna della Guardia is now a martial arts centre.
Meanwhile, the ancient Sidi Hammuda mosque was levelled to help widen Martyrs Square, renamed Green Square, a favourite speech venue of Col Qaddafi.
After disastrous experiments with socialism, Libya allowed private sector activity in the 1990s. Sanctions imposed in the 1980s and 90s were dropped by 2004.
For Tripoli, however, the benefits of investment were warped by corruption, with state companies continuing to dwarf the private sector and Col Qaddafi's sons controlling various sectors of the economy.
The city is a haphazard sprawl of concrete, with half-finished buildings and the central beach obliterated by a motorway.
Inland is Bab Al Aziziya, an army camp transformed into Col Qaddafi's fortified lair, with pea-green concrete walls, gun turrets and a warren of bunkers.
The royal palace long served as the "People's Palace" until it was made a history museum. Col Qaddafi's son Moatassim took over an office in the gardens after his father named him security adviser.
"When Nato began air strikes, Moatassim moved into the museum itself," said Islam Jaafar, an NTC fighter who helped storm the building on August 20.
Armed with fishermen's spear-guns and homemade pipe-bombs, Mr Jaafar said he and the other NTC fighters faced about 100 government soldiers.
"There were snipers in the upstairs windows," he said. "We threw our bombs over the gate and waited. At iftar, they all fled out the back."
NTC fighters have commandeered the building, piling the mattresses and dirty sheets of the government soldiers by the front steps.
With Col Qaddafi on the run as his regime collapses, the face of Tripoli is changing once more.
On the door of the ancient Saraya al Hamra, or Red Fort, Tripoli's new conquerors have graffitied their names as soldiers have done for centuries: "Misurata", "Zlitan Revolutionaries", and others.
Green Square is now Martyrs' Square again, and National Transitional Council banners have replaced the green flags and enormous portraits of Col Qaddafi.
From his cafe opposite the cathedral-turned-mosque, Mr El Margheni is watching the changes with a few ideas of his own.
"The idea that government builds buildings and hotels is old-fashioned," he says. "We need democracy, then open the door to the people. Let us build, let us establish companies, let us do everything."