Former Libyan Prime Minister Ali Zeidan was released after being abducted during a visit to Tripoli and held for nine days by an armed group, a relative said.
Zeidan was prime minister from 2012 to 2014, when Libya slid deeper into political turmoil and armed conflict that has plagued the country since Muammar Gaddafi was overthrown six years ago.
He has since been living in Germany with his family.
It is not clear why Zeidan travelled to Libya or why he was abducted. He was held by a group aligned with the UN-backed government in Tripoli, though he faced no judicial charges, a source said.
The UN-backed government has not commented.
Tripoli is controlled by a number of armed groups that have held power in the capital since 2011. Some have been given semi-official status by successive governments, but the groups remain unaccountable and involved in criminal activity.
A lawyer for Zeidan, Moussa Al-Doghali, told France 24 Arabic TV channel his client was released without explanation and he did not know the circumstances of his arrest and detention.
Zeidan was in good health and staying in a Tripoli hotel following his release, Doghali said.
In October 2013, Zeidan was briefly abducted from a Tripoli hotel by an armed group allied to the parliament that sacked him just over a year later.