Libyan military commander Khalifa Haftar secretly flew to Athens on Thursday for talks as Greece criticised its exclusion from a United Nations-backed peace conference in Berlin this weekend.

The Berlin talks are the latest international effort to end nine months of fighting between Haftar's forces based in the east of Libya and the UN-recognised government in Tripoli.

More:

Greece was not invited to take part in Berlin negotiations despite its stated interest, and Athens was angered by the Tripoli government signing a maritime and military cooperation deal with regional rival Turkey.

United States Secretary of State Mike Pompeo will attend the Berlin summit, and push for sustaining a fragile ceasefire and getting all foreign powers to withdraw from the conflict in the North African country, according to the US State Department.

Officials from Russia, Turkey, France, China, the United Arab Emirates and the United Kingdom - as well as several African and Arab countries - are also invited.

Greece was reportedly snubbed, with the German government rejecting Athens's claim that it was directly involved in the Libyan conflict. Greece has since signalled it wanted to participate.

In a surprise move, Haftar flew to Athens by private plane on Thursday for meetings not previously announced by the Greek government.

He was taken to a luxury Athens hotel where he was met by Greek Foreign Minister Nikos Dendias for an initial round of talks, television footage showed.

Dendias will see Haftar again on Friday at the foreign ministry, and the Libyan strongman is also expected to meet with Greek Prime Minister Kyriakos Mitsotakis later in the day, sources familiar with the issue told AFP news agency.

Greece has sought a more active role in Libya after the UN-recognised Government of National Accord (GNA) in Tripoli signed a maritime and military cooperation memorandum with Turkey in November carving out energy spheres of influence in the Mediterranean.

The Turkish deal claims much of the Mediterranean for energy exploration, conflicting with rival claims by Greece and Cyprus.

Greece expelled the GNA ambassador in protest over the Turkish agreement, and sought to boost links with Haftar. The Greek foreign minister flew to Benghazi to see him last month.

Mitsotakis said on Thursday that it was "wrong" to exclude Greece from the Berlin talks and that he would talk to German Chancellor Angela Merkel about it on Friday.

He added that Athens would veto at the European Union any Libya peace deal unless the Turkish memorandum that he described as "unacceptable and illegal" was scrapped.

"I've told European counterparts [that] Greece will never accept any political solution at [EU] summit level [that fails to] nullify this memorandum," Mitsotakis told Alpha TV.

"We will veto this even before it reaches a summit council," he said.

The talks in Berlin come as world powers step up efforts for a lasting ceasefire, since Haftar's assault on Tripoli in April last year sparked fighting that has killed more than 280 civilians and 2,000 fighters, displacing thousands.

Earlier on Thursday, German Foreign Minister Heiko Maas said Haftar was committed to a ceasefire and was willing to attend the Berlin summit. The pair met in Benghazi before Haftar travelled to Greece.