A video, apparently filmed in secret and which has been circulating online since yesterday, purports to show Abu Sahmein, head of Libya's General National Congress, answering questions from an unknown man about the presence of the women in his home.
Abu Sahmein, visibly worried, explains that a former assistant and another employee of the GNC had come to his home to return some documents.
"An inquiry has been opened into the content of a video published on the Internet ... Which could involve a crime of immorality," the public prosecutor's office said in a statement.
Abu Sahmein, head of the highest authority in Libya, at the time vehemently denied he had been kidnapped or arrested.
Extramarital sexual relations are forbidden in Libya, where the legal system is based on Islamic law.