I had driven past twice before. But on both occasions the black gates were firmly shut. On Sunday, however, they were tantalisingly ajar, and I managed to slip inside Tripoli's Libya museum. No one was around. The palace was once the home of King Idris, Libya's former ruler and the man whom Colonel Muammar Gaddafi brutally deposed in 1969.

The museum, I discovered, was a microcosm of the extraordinary revolutionary drama played out in Libya over the past two weeks. A couple of friendly rebels – Naiem and Islam – offered to show me around; they were guarding the building from looters. Gaddafi's officers had been living here in the final days of the war. Their soldiers had been kipping in the garden outside, hidden under the palm trees and bougainvillea.

The regime had calculated, correctly, that Nato was unlikely to bomb here. The loss to humanity had a missile struck would have been incalculable. Someone had carefully laid a Roman statue of Venus on a wooden pallet; one of Gaddafi's soldiers had been sleeping next to her on a mattress. An inscription read: "Statue of Venus demure, II century AD." Venus's hair coiled exquisitely down both shoulders; a cushion propped up her bottom.

The statues originally adorned Emperor Hadrian's sumptuous bathhouse in Leptis Magna, the mighty Roman city east of Tripoli. Near a statue of a young man wearing a Greek-style robe I found a pair of abandoned size 42 army boots. The soldiers had also left uneaten baguettes, a wardrobe full of khaki clothing and a tube of toothpaste. There was an unfinished bowl of soup. They had left in a hurry.

Naiem told me how he and other locals liberated the museum on Sunday 21 August – the day the rebels surged into western Tripoli, and a popular insurrection erupted inside it. The Gaddafi soldiers were armed; the locals had no weapons other than a small harpoon used for fishing trips. "Gaddafi was mad. He had hid soldiers in hospitals, museums and schools," Naiem said. "They left their clothes here and ran away."

Not all escaped: the rebels captured two of Gaddafi's soldiers trying to flee. One, Naiem said, admitted he genuinely liked Gaddafi. The other, however, explained that his officers had told him he wasn't fighting fellow Libyans but was going to war against France, Britain and Nato. "He didn't know the truth," Islam said. Both soldiers were now in a rebel prison, their fate unclear in a city without a justice system.

In a room devoted to Sabratha – Libya's other stunning Roman city – I found a bust of Marcus Aurelius. He had been taken out of his niche and propped carefully against a wall. Nearby was a female bust from a Roman necropolis, her expression dignified and mournful. I discovered more soldiers' mattresses in a room of Neolithic grinding stones and panels of early Saharan rock art – their primitive strokes recognisable as palm trees.

Upstairs, an entire room had been devoted to the Green Book, Gaddafi's barmy political treatise. The inscription in English was, predictably, glowing in its praise of Libya's mysterious and vanished leader. The "charming" Gaddafi led an audacious coup against the "medieval monarchy" of King Idris, it said, and took the bold step in 1973 of nationalising Libya's oil industry. Gaddafi's Third Universal Theory was a philosophy superior to both western capitalism and Soviet communism, I learned.

The most intriguing discovery lay in the basement. Here, I found exhibits from the pre-Gaddafi era, carefully stored away, as well as King Idris's palace furniture, smelling strongly of mothballs. There was a gilded Buddha, water pitchers, and a series of framed prints — a 19th-century French lithograph of the Bosporus, and portraits of Libyan nationalists who fought a century ago against Italian colonial rule. All had been hidden. "We have many heroes in Libya. But Gaddafi wanted to be the only one," Naiem observed.

The rebels had hung their tricolour from the museum's roof. (They had nervously stormed its domed storerooms – searching for snipers — but had failed to find any.) The view was stunning: one side looked out on to the pan-African news agency building, and the white Italianate facades of Victory Street; from the other you could see the burned-out offices of Gaddafi's son and national security adviser Muatassim. Over a large wall was King Idris's green mosque.

Should Libya now go back to an Idris-style constitutional monarchy? "I don't think kings are good for Libya. We need a republic I think," Naiem answered politely. "We need democracy, and different people in power. We don't want one-person rule. No more Gaddafi or Hitler." This sentiment is universal in Libya: everyone agrees that the country should be reborn as something different. The details can be figured out later. "I feel so alive now," Naiem, a computer engineeer, now carrying a kalashnikov, said.

In the museum's ornamental gardens I found one of the regime's many getaway vehicles – a black, bulletproof S-350 Mercedes. The two soldiers caught by the rebels had unsuccessfully tried to hotwire it; a bullet had smacked into but not shattered the windscreen, further proof of the virtue of German engineering. Glass was scattered over the luxurious beige leather seating.

In the front seat I found a receipt in the name of Mohamed El-Ghawi. Mr El-Ghawi had run up a large bill in the restaurant of a five-star hotel in Tunisia. He, like most other senior figures from the regime, had apparently got away. Naiem said that when he first searched the museum's basement he had fantasised that Gaddafi might be down there: for the moment the hunt goes on. He told me: "For some reason he likes tunnels. We have no metro in Libya. But Gaddafi is always under the ground."

• This article was amended on 31 August 2011. The original referred to Gaddafi's Green Book as a "balmy political treatise". This has been corrected.