Members of the Tripoli Rebels Brigade militia set up a checkpoint on a main road in Tajura on Saturday after foiling attempts by Misrata-based militiamen to advance into the city earlier in the day. (MAHMUD TURKIA/AFP/Getty Images)

Soldiers and government-affiliated militias stormed a military base occupied by gunmen near Libya’s capital Saturday, sparking fresh fighting that left four dead a day after a deadly militia attack on protesters.

Armed residents and pro-government militiamen set up checkpoints across Tripoli as thousands of protesters gathered in the city center to mourn the 43 killed in Friday’s attack when militias fired on a crowd urging the dissolution of unlawful armed groups.

Friday’s demonstrations had been the biggest show of public anger over militias in months. About 500 people were wounded, health officials said. On Saturday, some residents of Tripoli said they will go on strike until unlawful militias are disbanded.

Since the fall of longtime autocrat Moammar Gaddafi in 2011, hundreds of militias — many on the government payroll — have sprung up across Libya, carving out zones of power, defying state authority and launching attacks. The government has tried to incorporate them into the fledgling police force and army but has failed.

Saturday’s violence started at dawn when militiamen from the coastal city of Misurata raided the base in Tajura east of the capital, taking arms and ammunition before escaping to the outskirts , Col. Musbah al-Harna told the LANA state news agency from the base.

A fighter on the government side said one of his comrades was shot dead in the fighting. A hospital official later said that three others were killed and 13 people were wounded.

Later in the day, government-affiliated militias and residents erected checkpoints along the road from Tajura to the center of the capital, checking IDs and searching cars in hopes of preventing outside militiamen from entering.

Prime Minister Ali Zeidan told militias from outside the capital not to enter, saying it could lead to a “bloodbath,” LANA reported.

Zeidan, who was briefly kidnapped by militiamen last month, said Friday his embattled government was working on a plan to drive all militias out of Tripoli.

Meanwhile, mourners gathered in Martyrs’ Square, a focal point of the country’s uprising against Gaddafi, to pray for the dead and call for civil disobedience. A statement drafted by Tripoli officials in the name of the city’s inhabitants and read out to the crowd vowed to keep protests going until militias leave the capital.

Secretary of State John F. Kerry condemned the violence in a statement Saturday, urging “all sides to exercise restraint and restore calm.”

— Associated Press