TRIPOLI (Reuters) - Gunmen killed at least four people and wounded nearly 40 on Wednesday in a suicide attack on a court complex in the Libyan city of Misrata, officials and a witness said. Islamic State claimed responsibility for the attack, saying in a statement run by the group s Amaq news agency it had targeted  one of the most prominent strongholds  of Libya s U.N.-backed Government of National Accord (GNA). The attack shows the enduring militant threat in Libya after a Misrata-led coalition under nominal GNA command battled for more than six months last year to oust Islamic State from its former stronghold in Sirte, about 230 km (140 miles) southeast of Misrata. Since then, militants have been trying to regroup in the desert south of Sirte. They have stepped up their presence in remote areas, though attacks in urban centers have been rare.             Wednesday s attack was launched by several assailants who drove up to the complex in central Misrata in a black vehicle, a witness said.  One of them blew himself up at the gate and the other two with Kalashnikovs opened fire at random,  he said.  Shooting could be heard all over the city center after the attack.  The witness, who asked not to be named, said he believed the attackers had used rocket propelled grenades. The military alliance from Misrata that led the campaign in Sirte said two suicide attackers were involved in the operation, and that there had been an explosion after a gun battle lasting about 20 minutes. The attackers killed four and wounded 39, Misrata hospital said in a statement, listing names of victims. Two of the attackers blew themselves up and a third was killed during the gun battle, said a local security source, speaking on condition of anonymity. Bomb disposal experts also defused a booby-trapped car that had been packed with explosives to be used in the attack, he said. Misrata, a large commercial port about 190 km east of Tripoli, is one of Libya s major military power bases but the city itself has been largely immune from armed clashes and attacks in recent years. Dozens of Islamic State suspects are being held in the city. Libya slid into turmoil after a NATO-backed uprising that toppled long-time leader Muammar Gaddafi six years ago. It remains divided between loose political and military alliances based in the east and west, resulting in a security vacuum in the center of the country. As militants increased their activity in recent weeks to the south and east of Sirte, the United States launched two sets of air strikes against jihadist desert camps. The U.S. also provided air support for the Misrata-led campaign last year. 