They were elite, professionally trained troops guarding a critical source of the regime’s power: the headquarters of Libya’s propaganda-spewing state television.

But when unarmed protesters took to the streets, the feared guards, members of brigades known as Katibas, simply took off their uniforms, lay down their weapons and ran.

“Underneath their uniforms, they had civilian clothes, jeans and T-shirts, as though they were expecting this,” said Badr Ben Jered, a 25-year-old employee in Nokia’s marketing division, patrolling his neighborhood with a Kalashnikov rifle. “Then people started screaming, ‘The Katiba are running! The Katiba are running!’ We were so shocked, and still so scared of them, no one even went after them.”

The guns have been collected, but abandoned uniforms still litter the ground around the television station and elsewhere in Tripoli, evidence of a gigantic loss of nerve, the sudden crumbling of a regime built on brutality and fear.

Its rapid disintegration Aug. 20 and 21 suggests that support for Moammar Gaddafi was far more shallow than the government had portrayed over the course of the six-month uprising.

But the way many of Gaddafi’s supporters just melted away into the night also prompts concern about whether some die-hard loyalists are simply lying low, waiting for the day they can regroup and launch their own insurgency.

Elements of the former government have already signaled their continued defiance. Gaddafi’s most influential son, Saif al-Islam, issued a statement to a Syrian-owned satellite television channel Wednesday in which he urged followers to fight to the death against the Transitional National Council, the new de facto government of Libya.

“We assure people we are here, ready and in good shape. Resistance is continuing, and victory is near,” he said. He boasted that 20,000 fighters loyal to his father — who is still at large — remain in the Gaddafi stronghold of Sirte.

And yet, when it came time to battle the rebels for control of Tripoli, the Gaddafi government did not put up much of a fight. Since February, when the uprising began, there was a gradual hollowing out of the regime from within that seems to have finally precipitated its collapse.

For months, many state employees had not been turning up for work — some because the government had ceased to function properly, but many because they were simply boycotting the regime.

One of the key defections was that of Mohammed al-Barani Eshkal, who commanded the brigade guarding the television station and was charged with protecting Gaddafi in his main Bab al-Aziziya compound.

Eshkal had played a finely nuanced game, working for the Libyan leader while simultaneously assuring the rebels that if their fighters arrived at the gates of the capital, he would instruct his men to lay down their weapons. That is exactly what happened, according to rebel officials in Benghazi.

Operation Mermaid Dawn

Rebel commanders — working in conjunction with NATO — had long been plotting an uprising of Tripoli residents to coincide with an opposition advance into the capital.

The start of Operation Mermaid Dawn was set for Aug. 20, the six-month mark of the uprising in Tripoli and the 20th day of the Muslim holy month of Ramadan. The day is symbolic among Muslims because it marks the anniversary of the prophet Muhammad’s entrance into Mecca to retake his home town.

“The day was studied carefully based on the deterioration of Gaddafi’s power in Tripoli, and as we got closer to the capital, we chose the day for its symbolism,” said Mustafa Sagazly, the deputy interior minister for the rebel government.

Outside Tripoli, the military tide had turned sharply against Gaddafi in mid-August with the fall of the eastern city of Zlitan and the garrison mountain town of Gharyan. But the critical rebel victory came about in the gateway city of Zawiyah, which cost Gaddafi his last oil refinery and his coastal lifeline to Tunisia.

Attempts by Gaddafi’s forces to reinforce Zawiyah and Gharyan from Tripoli were spotted by NATO and quashed with airstrikes, said a NATO official, who was not authorized to speak on the record. Then government checkpoints on the way to the capital also were struck.

“We knew we had to come from the east, west and south,” said Fathi Baja, the head of political affairs for the rebel council. “We designed the plan in connection with NATO so they could start the operation by hitting the checkpoints.”

News of Zawiyah’s fall turned the mood in Tripoli, as residents who had endured 42 years of Gaddafi rule realized that his defeat was within reach.

Rebel officials in Benghazi said underground dissidents, as well as lawyers, journalists, doctors and drivers, were primed to bring people out on the streets, with armed sleeper cells ready to do the fighting.

On the afternoon of Aug. 20, a Friday, young men took over the microphone at a Tripoli mosque to broadcast a message to Gaddafi’s troops.

“Raise the white flag and nobody will touch you,” one young man proclaimed, according to residents who heard the announcement. “Lay down your arms, and I promise you we will break our fast together this evening. We are all Libyans. We don’t want to kill you, we don’t want to hurt you. How many are you going to kill? 10? 20? 30? You can’t kill us all.”

A homemade video shows young men cautiously making their way onto the streets in the capital’s Zawiyat al-Dahmani district. Machine-gun fire crackles, and they briefly retreat, but soon they are advancing again.

Gradually the streets start to fill, and the red, black and green rebel flag emerges from people’s homes.

When rebels streamed into the capital Aug. 21 and 22 from Misurata to the east and Zawiyah to the west, they found many districts “liberated,” even if there was still fierce fighting ahead to overtake the Bab al-Aziziya compound and loyalist neighborhoods such as Abu Salim.

“I thought most of us would die,” said Mohammed Fallah, 23, a rebel fighter. “We thought there would be a lot of blood in Tripoli, but we were very surprised, very happy at what happened here.”

Fallah said Gaddafi’s troops had put up a far less potent fight than he had expected. “I thought, ‘Is that all Gaddafi can do?’ He was the bogeyman, but once the people of Tripoli got over their fear, they found themselves free.”

Hard-core government loyalists were surprised, too, at how quickly the city fell.

In the Rixos hotel, Moussa Ibrahim, a Gaddafi spokesman, left with his entourage Aug. 21. Today, in what was once his room, an open suitcase and his infant son’s toys lie scattered on the ground, evidence that his wife did not even have time to pack as she ran out of the hotel, her son in her arms.

‘Please forgive me’

More than a week after Tripoli fell, the bulk of Gaddafi’s remaining forces appear to have regrouped in his home town and tribal stronghold of Sirte.

But they are also in Tripoli. Some, no doubt, are preparing for battles to come; others have begun to curry favor with the very people they once subjugated.

Hamza Mhani, a prisoner under Gaddafi, recalled watching on the night of Aug. 20 as prison guards shed their uniforms, stashed weapons in the trunks of their vehicles and drove away before they could be vanquished by the rebels.

One guard, whom Mhani describes as the most conspicuously loyal to Gaddafi, stopped to free the prisoners.

“He was crying and saying, ‘Please forgive me,’ ” Mhani said.

As the guard unlocked the cells, Mhani said, he repeated again and again: “I am now doing what was always in my head to do.”

Fadel reported from Benghazi. Correspondent Michael Birnbaum in Cairo contributed to this report.

Related stories on Libya

- The political rise and fall of Moammar Gaddafi

- Moammar Gaddafi through the years

- The battle for Libya

- Gaddafi bunkers and tunnels an elaborate setup

- Read more stories from around the world