The threat of a military clash in the Mediterranean has drawn nearer following talks in which Turkey has underlined its willingness to send troops to Libya to defend the country’s UN-recognised government.

Such a move would risk a direct military confrontation with General Khalifa Haftar, the eastern Libyan military warlord who is thought to be planning a decisive assault on the government of national accord in Tripoli, or GNA. Either the UAE or Egypt, which are supporting Haftar’s forces, might also become involved.

Turkey, already at loggerheads with the US Congress and EU on multiple fronts, last week signed a military co-operation agreement with GNA that enables it to request troops from Turkey. The agreement, sent to the Turkish parliament on Saturday, provides for a so-called quick reaction force for police and military in Libya, as well as enhanced cooperation on intelligence and defence.

Turkish support for the GNA government led by Fayez al Serraj has until now been limited to drones and armaments, and it would be a major escalation to send ground troops to defend Tripoli.

Turkey’s foreign minister, Mevlüt Çavuşoğlu, and its defence minister, Hulusi Akar met with Serraj on the sidelines of a major diplomatic conference in Doha, Qatar at the weekend. Çavuşoğlu, speaking in Doha, said no formal request for troops has yet been made by the GNA, but added “sending troops is the easiest way”.

Haftar’s airforce, backed by the United Arab Emirates and Egypt, has already bombed the airport of the Libyan coastal town of Misrata in a warning to Turkey not to send troops or further supplies.

Turkey, along with the UAE, was formally found by the UN to be breaking the UN arms embargo, but the Turkish government seems determined not to let Tripoli to fall into hands of the UAE-backed Haftar.

Haftar claims to be removing Islamist terrorists from Tripoli. His opponents describe him as a war criminal who will snuff out any chance of democracy in Libya.

Haftar’s assault was launched in April, but until now has been bogged down in the suburbs of the capital.

The already multi-layered conflict has been made more complex by the arrival of 200 Russian mercenaries backing Haftar, an intervention that Serraj is highlighting to drum up support for his government in Washington.

Serraj met the the influential Republican senator Lindsey Graham, a confidante of president Donald Trump, on the sidelines of the Doha conference to warn about Russian intervention. The Turkish president Recep Tayyip Erdoğan has also urged Putin to order the troops to withdraw.

As part of a binding together of Turkey and the Tripoli government, the two sides have also drawn up a memorandum of understanding to carve out drilling rights in the Mediterranean that has infuriated the European Union, and in particular Greece. Athens says the exclusive economic zone agreement in effect blocks Greece from drilling around Crete and is illegal.

It has already expelled the Libyan ambassador to Greece but not yet broken off diplomatic relations.

Ankara’s actions risk an anti-Turkish coalition forming comprising Greece, Cyprus, Egypt, Israel, Jordan and Italy. These countries came together under the umbrella of the eastern Mediterranean gas forum – an outwardly energy-related but ultimately military partnership from which Turkey was excluded. The natural gas reserves in the region are estimated to be around 122 trillion cubic meters in total.

Turkey has warned the EU it has no right to declare its agreement with Libya unlawful.

In the third Turkish foreign policy flashpoint with the US, Çavuşoğlu also said Turkey would not rescind its deal with Russia over the S-400 missile defence system. He said “it is a done deal. We cannot cancel this. This is for sure, whatever the consequences, this is the situation”.

The US Congress, also angry Turkish intervention in Syria, has said the use of the S-400 defence system is incompatible with Turkey’s membership of Nato, and called for sanctions. Graham warned in Doha “if there was a vote in the senate for sanctions it would receive 90% support, and be veto-proof. The one thing that Erdoğan did that no one else could do is to unite the Republicans and Democrats”.

Çavuşoğlu responded: “Sanctions and threatening language never work. But if sanctions are placed, Turkey has to reciprocate.

“We are very desperate for an air defence system. From the last 10 years, we tried to procure it from the US and others, but it didn’t work. The Russians gave us the S-400 and it was the best deal”.

The US approved the sale of the Patriot missiles last December in the hope that Turkey would tear up the deal for the rival Russian surface-to-air missiles. But the Russian deliveries went ahead and the US said in August that its offer was off the table.

The US has started unwinding Turkey from their joint program to build F-35 fighters and has threatened it will not sell the jets to Ankara for fear the technology could be compromised by the proximity to Russian technicians servicing the S-400.

In a sign of the deteriorating relations between Turkey and the US Congress, if not the White House, the Senate on Thursday unanimously passed a resolution officially recognizing the Armenian genocide, joining the House in condemning the Ottoman Turkish mass slaughter of 1.5 million people early last century.

The move follows a Wednesday vote in the Senate armed services committee to impose sanctions on Turkey over its recent purchase of a Russian missile system and its offensive against the Kurdish minority in Syria.

The Turkish foreign minister said Turkey was willing to set up a joint working group including scientists historians and anthropologists to open the archives.

Meanwhile, at the same conference, Iran’s foreign minister Javad Zarif made a pitch for a new Middle East security architecture saying the current “exclusion, rivalry, and unending arms race” brings safety to no country in the region.

He also claimed the Iran nuclear deal need not be seen as a ceiling, but as a foundation, remarks that suggest Iran might be willing, in the right circumstances, to negotiate a further agreement following the US pullout from the deal in 2018.

Zarif made no mention in his speech either to the anti-Iranian character of the protests in Iraq and Lebanon or to the recent street protests within Iran itself over the rise of fuel prices. But on the sidelines of the Doha conference he did meet with Iraqi security officials.