"A man shot him in his apartment and fled," a member of Libya's high security committee said on condition of anonymity.
The motive of the murder was still unknown, he said.
Another Libyan security source told the AFP news agency that the victim was a retired French serviceman, adding that a Libyan had been arrested in connection with the killing and that an investigation had been launched.
A French embassy source confirmed the murder.
“Yes, he is a former French military member who had retired and was working in Libya," the source said, also speaking on condition of anonymity. "We are currently occupied with the repatriation of the body and have initiated the necessary procedures with the Libyan authorities.”