TRIPOLI - A car bomb attack claimed by the Islamic State group has killed nine people and wounded dozens in Libya’s eastern coastal city of Derna, a medical source said.

“Nine persons were killed and dozens wounded in a car bomb in Derna city” on Sunday night, a medical official in eastern Libya told AFP by telephone. “Some of the dead and wounded are civilians.”

IS said it was behind the attack and that it was carried out by a Sudanese militant.

“The martyr Abu Jaafar al-Sudani blew up his car bomb... in the city of Derna, causing many dead and wounded,” read a statement the group posted online.

The jihadist group’s fighters last month lost control of Derna, which had been a bastion of IS since late last year. IS promised to avenge its fighters in a video posted online. After the fall of dictator Moamer Gaddafi in 2011, Libya now has two governments vying for power in the oil-rich country, one based in Tripoli in the west and another internationally recognised in Tobruk, to the east of Derna.

Meanwhile, a Libyan official visited a prison in rebel-held Tripoli on Monday to meet detainees including a son of slain dictator Moamer Gaddafi, after claims that he was ill-treated in jail.

The visit by Mustafa al-Kulaib, justice minister in the Tripoli-based government, comes after Human Rights Watch called for a probe into reported abuse of prisoners at Al-Hadba prison.

HRW made the request last week after an undated video posted on an Arab news website earlier this month showed prison guards and officials beating up prisoners including Saadi Gaddafi.

“The situation does not really reflect what people are saying,” Kulaib said after touring Al-Hadba and speaking to detainees. Al-Hadba is controlled by the Fajr Libya militia coalition which seized Tripoli last year and is opposed to the internationally recognised government which is based in the east.

Kulaib said he condemns ill-treatment of detainees, but added that if such cases exist they are only “isolated incidents”, promising to investigate any abuse. “We’re not saying conditions in this institution or others are perfect, but what we want to say to the world is that we cannot do better at the moment, and we cannot fix the situation in the prisons overnight,” he said. “We will work firmly against those who commit such acts in the future and will investigate all these isolated incidents.”

Kulaib met Saadi, Gaddafi’s third-oldest son, who was wearing blue prison uniform, and Gaddafi’s last prime minister Al-Baghdadi al-Mahmudi.

In July, a court sentenced to death another Gaddafi son, his one-time heir apparent Seif al-Islam, and eight of his aides including Mahmudi for crimes during the 2011 uprising.

Seif al-Islam, who is also wanted by the International Criminal Court (ICC), was tried in his absence because he is being held by a militia that opposes the Tripoli authorities. His brother Saadi was extradited in March 2014 from Niger, where he had sought refuge after the 2011 uprising.

Three of Gaddafi’s seven sons were killed in the uprising. Gaddafi himself was captured and killed by rebels in October 2011.

Libya plunged into chaos after the uprising and now has two parliaments and two governments vying for power as well as a slew of armed groups battling to control its oil wealth.