Five people were killed and nearly 100 were wounded in clashes between rival armed militias in Libya’s capital on Wednesday, Health Minister Nurideen Doghman said.

Loud explosions and gunfire rocked Tripoli late into the night - the second day of violence in the battle-scarred city, highlighting the rivalries between heavily armed groups that have plagued the country since the fall of Muammar Qaddafi.

Armed groups made up of former rebel fighters from different parts of the country have grown in power and ambition nearly two years after Qaddafi was ousted, and the government has struggled to impose its authority over them.

“In total 97 people were wounded and five were killed in yesterday’s clashes,” Doghman said on state television.

In a separate incident in the southern desert town of Sabha, he said two people were killed and 17 were injured when three car bombs exploded in different areas late on Wednesday.

“Some of the injured will be transferred to Tripoli because their condition is critical,” he said.

The fighting in Tripoli started on Tuesday morning when a militia given the job of guarding a major oilfield attacked the headquarters of the national force set up to guard oil facilities across the country.

The group from the western town of Zintan was disgruntled after another group was given supervision of a drilling operation in the area, officials said. That fighting stirred widespread resentment in Tripoli against fighters from Zintan and by Wednesday, parts of the city were caught in fighting between people from that town and other areas.

Underlining the complexity of the situation, Wednesday’s violence pitted a separate group from Zintan against fighters from the Tripoli-based Supreme Security Committee (SSC).

The SSC had lost a commander in earlier fighting on Tuesday. Other security sources said the Zintan group may have launched are venge attack after some of their men were seized.