Libyan Gen. Khalifa Hifter met with Greek Foreign Minister Nikos Dendias. He will meet later with Prime Minister Kyriakos Mitsotakis as well as with other senior Greek officials.
The surprise visit by Hifter takes place ahead of a weekend summit in Berlin aimed at halting the conflict in oil-rich Libya that is being fueled by competing international support for the warring sides.
Turkey, which has promised to send troops to back Libya's government against Hifter's offensive, is at odds with Greece over oil-and-gas drilling rights in the East Mediterranean.
In November, Turkey and Libya signed a controversial maritime boundary deal in the East Mediterranean in opposition to earlier agreements that include Greece, Cyprus, Egypt and Israel.
Speaking after the meeting, Dendias said the Greek government had encouraged Hifter to work to achieve a cease-fire and restore security in Libya "by removing the mercenaries and by recognition of the non-validity of the illegal agreements between Turkey and the (Libyan) government."
He added: "l must tell you with great pleasure that the commander agreed to all of those remarks."
Dendias said Greece was willing to help police a European ban on arms shipments to Libya.
Late Thursday, Prime Minister Mitsotakis, who was not invited to the summit in Berlin, warned that Greece will use its veto powers as a European Union member to try to block a Libya agreement unless Turkey's maritime deal is canceled.
It was not immediately clear exactly what Greece could block, as the summit in Berlin is not being held by the EU and a Libyan deal does not need EU approval. A Greek official, speaking on condition of anonymity, said the veto would be applied to "any decision concerning Libya on a European level if it doesn't include the annulment" of the maritime deal.
"Greece sought to participate in the Berlin meeting on Libya. The Greek government considers that Turkey's participation could hardly be productive, given that Turkey is part of the military conflict, as it is deploying troops to Libya," said George Pagoulatos, head of the Hellenic Foundation for European and Foreign Policy.
Police maintained a heavy security presence outside the hotel next to parliament in central Athens where Hifter is staying.