The commander of forces fighting the UN-supported government in war-torn Libya held meetings in Athens on Friday in a bid to counter Turkey's support for his opponents.
Libyan General Khalifa Hifter met with Greek Foreign Minister Nikos Dendias at the Greek Foreign Ministry.
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 ceasefire 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."