Saif al-Islam Gaddafi, the son of deposed Libyan leader Muammar Gaddafi, has been freed by an armed group holding him in the western Libyan town of Zintan, where he was taken after the 2011 revolt against his father, according to one of his lawyers and a statement from the brigade.

The Abu Bakr al-Sadiq Brigade, a militia of former rebels that controls Zintan, said Saif al-Islam was freed on Friday evening, "the 14th day of the month of Ramadan," under an amnesty law promulgated by the parliament based in the east of Libya.

His lawyer, Khaled al-Zaidi, said Saif al-Islam was headed to another Libyan city, but he could not say where for security reasons.

The North African country has rival administrations, with the authorities in the east not recognising the UN-backed Government of National Accord (GNA) in the capital. Zintan is controlled by armed groups opposed to the GNA.

Political rivalry and fighting between militias has hampered Libya's efforts to recover from the chaos that followed the 2011 uprising that toppled and killed Saif al-Islam's father and saw him jailed.

Rival authorities and militias have been vying for control of the oil-rich country ever since.

Previous reports that Saif al-Islam had been released from Zintan turned out to be false, and there have been conflicting reports about his status since his capture.

"We have decided to liberate Saif al-Islam Muammar Gaddafi. He is now free and has left the city of Zintan," the statement from the the Abu Bakr al-Sadiq Brigade on Facebook said.

1- Big big news. Saif al Islam al-Gaddafi has been released from prison by rebels in western Libya. @akhbar pic.twitter.com/1KCJpuCnJ6 — Jenan Moussa (@jenanmoussa) June 10, 2017

Saif al-Islam's release may fuel even more fighting in the country, according to the Libyan Observer's website.

The son of the former dictator is the subject of an arrest warrant for crimes against humanity allegedly committed during the eight months of the uprising in 2011.

Libya's authorities and the International Criminal Court are in dispute over who has the right to judge him.

He was sentenced to death in July 2015 by a court in Tripoli for his role in the murderous repression of the 2011 revolt.

The Zintan militia refused to comply with the court, the Libyan Observer said.

Saif al-Islam, 44, was born on 25 June 1972. His name means "sword of Islam," and he is the second of Gaddafi's eight children, the eldest son of his second wife, Safiya.

Saif al-Islam is questioned by judges in Tripoli in 2014 (AFP/file photo)

The fluent English-speaker often appeared in the West as the public face of his father's regime.

He held no official post but had influence as a loyal emissary of the regime and architect of reform.

In July 2016, Saif al-Islam's lawyers claimed that their client had been released under an amnesty issued by the unrecognised authorities in the east of the country.

But the GNA said the amnesty, enacted in April that year, cannot apply to persons accused of crimes against humanity.

Three of Gaddafi's seven sons died during the revolution.

One son who survived, Saadi, is still on trial in Libya for his alleged involvement in the crackdown and slaying of a former football coach.

The deposed dictator's widow - Safiya - and three more of their children found refuge in Algeria in the wake of the revolution, then later in Oman.

The shockwaves created by the removal from power and grisly killing of the dictator by rebels in his hometown of Sirte continue to ripple across the troubled country.

Late last month, Tripoli was rocked by fierce clashes between forces loyal to the unity government and rival militias, with more than 50 members of the pro-GNA forces reportedly killed.

Relying on militia support and pitted against the rival administration in the east, the GNA struggles to assert its authority.