As the sun set on Bourguiba Avenue in central Tunis, the lull of a distant call to prayer was drowned out by the relentless crackle of machine-gun fire as soldiers darted for cover from tree to tree along the deserted boulevard. Up above, on top of the interior ministry whose basements had housed the regime's torture rooms, snipers were firing down into the street.

"The old police loyal to Ben Ali are shooting from the roof," said a police officer as he hurried from room to room of a nearby hotel, crawling across the carpet to check windows were closed. Military helicopters hovered overhead as the gun battle raged.

There were other skirmishes outside the central bank and the PDP opposition party headquarters.

On the Mediterranean shore at Carthage, north of the capital, there was sporadic gunfire as fighting continued at the presidential palace. Residents barricaded themselves in homes, saying palace guards loyal to the ousted dictator were resisting the army.

Confusion reigned. For the first time in the Arab world, a people had forced out a leader by spontaneously and peacefully taking to the street. But although Zine al-Abedine Ben Ali has fled, the diehards of his brutal police force have not. During the day random yellow taxi-loads of militia loyal to the ousted leader had careered through the capital and some suburbs, firing randomly into the air. Armed gangs broke into homes and ransacked them, or fired shots in the street.

In the early morning, after the curfew that shuts down Tunis at night, some residents ventured out for coffee at the few cafes that were open, often in the shadow of tanks positioned on intersections. Later, tension ran high. By lunchtime, one hospital morgue in Tunis had registered 13 dead, including five police officers. "This is being done by Ben Ali's old torturers, they have arms, they want to create chaos," said an activist from one opposition party.

In residential areas across the country, locals formed vigilante groups to defend themselves against the gangs they feared were led by Ben Ali's police. In La Marsa, a middle-class suburb to the north, streets were blockaded by old bits of broken doors, plant pots, water cans, bricks and paving slabs, to stop cars speeding through for drive-by shootings or houses being ransacked. Omar, 18, a well-dressed sixth-former who wanted to go to art college, had been standing guard until 3am as part of a hastily-formed group. "There were 30 of us, including my schoolfriends and my dad. We armed ourselves with sticks and whatever we could find, and wore white armbands so the army knew who we were." As he stood talking outside a smart shopping centre protected by a tank, a soldier warned him to move, as there had been reports of a taxi marauding through the area containing gunmen firing from its windows.

"We'll never forgive Ben Ali for unleashing his militia on the country," said one elderly lady. "More than the corruption of his regime, this is what we will never, ever forgive him for."

Meanwhile, the full horror of repression over four weeks of demonstrations is beginning to emerge. Human rights groups estimate at least 150-200 deaths since 17 December. In random roundups in poor, rural areas youths were shot in the head and dumped far from home so bodies could not be identified. Police also raped women in their houses in poor neighbourhoods in and around Kasserine in the rural interior.

Sihem Bensedrine, head of the National Council for Civil Liberties, said: "These were random, a sort of reprisal against the people. In poor areas, women who had nothing to do with anything, were raped in front of their families. Guns held back the men; the women were raped in front of them." A handful of cases were reported in Kasserine and Thala last Monday. Rape was often used as a torture technique under the regime; opposition women report they were raped in the basement of the interior ministry, as were men, too.

Rights lawyers were also gathering information on those murdered and dumped far from their villages, thrown into cemetery grounds, or offloaded at the side of the road or outside hospitals. These shootings were believed to have taken place in the past ten days. "Lots of these bodies are yet to be identified; they were purposely dumped far from their homes. Families think their young ones have been arrested. They don't know they are never coming back," said Bensedrine, who herself had been beaten and forced into exile before returning in recent days. You have to understand that under Ben Ali, it was a regime of torture, with beating, harassment and intimidation but not necessarily mass killing. The past four weeks has been different; it's a massacre, it's something else."

Ahlem Belhadj, a psychiatrist and women's rights activist, said people felt robbed of the joy of Ben Ali's departure by the chaos that had ensued. She said the spontaneous protest movement – and the unemployed undergraduate who started it by setting himself alight – had showed the desperation of a population who felt repressed, humiliated, with no chance of jobs or prospects after 23 years of despotism.

"We had become a nation of hunger strikers; there was no other political or social means of dissent.

"Then, for people to set themselves alight, was extreme: it showed there was such a fear of the 'other', the regime, that people could only turn the aggression on themselves. It was self-destruction as a way of fighting."

Khelil Ezzaouia, an orthopaedic surgeon and trade union figure tipped for a post in the interim government, hoped the chaos would be brought under control, and that commissions set up into rights abuses, political reform and corruption. He said: "There will be a temporary transition government to show the page of Ben Ali has been closed, and to send out a strong signal to reassure the population."

On national state radio, a tool of regime power until days ago, DJs spoke freely for the first time, but had to regret that the joy of a dictator's departure had been tempered by a fear of the militia attacks.

"Ours is a difficult happiness," sighed one music show presenter, before putting on another 1960s resistance song.