CAIRO — A son and the onetime heir apparent of Libya’s deceased former dictator, Col. Muammar el-Qaddafi, was quietly released on Friday by the militia that had held him captive since the Arab Spring uprising of 2011, which ended his family’s brutal rule.

In an online statement on Saturday, the militia, the Abu Bakr Sadeek Brigade of the northwestern city of Zintan, said they allowed Seif al-Islam el-Qaddafi to leave the city on Friday.

Mr. Qaddafi’s release was a direct challenge to the extradition efforts by the United Nations and the International Criminal Court, which has said Mr. Qaddafi should stand trial on war crimes charges at The Hague. He was convicted of such charges in 2015 by a Libyan court in the country’s capital, Tripoli.

Friday’s move highlights the turmoil that has gripped Libya since the Arab Spring uprising. The country is mainly divided between three factions: an internationally recognized but weak government in Tripoli; a rival Islamist body, also in Tripoli; and an anti-Islamist government in the east. The chaos has turned the North African country into a criminal hub for human trafficking and weapons smuggling. Its beaches were a departure point for many of the estimated 180,000 migrants who illegally reached Italy last year.