The defeat of Muammar Gaddafi and his regime after four decades of often brutal rule could not have been achieved without Western air support largely orchestrated by David Cameron and Nicolas Sarkozy.

In the chaotic aftermath, Britain, France and the international community walked away. Now the European Union is proposing action once more. But this is not to help Libya, but protect the borders of Europe from African and Arab migrants, using Libya as a battleground against heavily armed trafficking gangs if necessary.

That is the view of many in Libya and Prime Minister Khalifa al-Ghweil is convinced that this is exactly the wrong approach. “The answer is not to carry out unauthorised attacks, bomb boats, but to take part in dialogue to talk to each other and solve this problem which concerns both us and Europe. Surely that is the logical thing to do.”

Mr Ghweil expressed his concern as the European Union revealed that its ships and aircraft were operating closer to Libya than ever before. Fabrice Leggeri, the director of the organisation’s border agency, Frontex, stated that they “are approximately 80 nautical miles from the Libyan shore”. They may have to go in even closer, he continued, as “most rescue emergencies happen 40 nautical miles from Libya”.

As well as concern over refugees, there is alarm in the US and Europe about the growing presence of Isis in Libya, with the group taking over cities including Sirte, Muammar Gaddafi’s birthplace, and carrying out mass beheadings and suicide bombings.

But the international community does not recognise the Libya Dawn government, headed by Mr Ghweil, formed after the country divided last year following fierce fighting in Tripoli. It was the latest in the rounds of blood-letting which had followed the revolution and the fall of the regime. Instead, a rival administration, based in Tobruk, is regarded as the legitimate government. However, the European Union has not consulted it either.

Prime Minister Khalifa al-Ghweil says the EU is compounding the problem by not co-operating with his administration

The sources of migration are found in the west of the country, where the Tripoli administration’s remit supposedly runs. Mr Ghweil maintained: “Europe and America should recognise our National Salvation Government: we control 85 per cent of the country where these issues are taking place. What is the point of them dealing with the Benghazi government? The West needs to talk to us or these problems, about migration, about Daesh [Isis], to make sure the situation does not become worse for them.”

The Tobruk Prime Minister, Abdullah al-Thinni, survived an assassination attempt earlier in the week when a convoy of cars he was travelling in was ambushed. “That just showed that people in those parts don’t like them either”, said Mr Ghweil.

The revolution of 2011 was followed by a disintegration of the political process, instability, violence and fiefdoms carved out by rival militias. An exodus has followed of foreign businesses, aid organisations, diplomats and the UN. Almost all the foreign embassies have now pulled out of Tripoli.

Libya Dawn officials want to stress, however, that the situation is calming down, law and order is being restored, and forces have been sent to confront Isis. They accuse hostile propaganda at home and abroad of trying to smear them as extremists with the aim of keeping them as pariahs.

Mr Ghweil took over as Prime Minister three months ago after his predecessor Omar al-Hassi was dismissed by the General National Congress amid allegations that he had misled parliament on the state of the country’s finances.

Outwardly, at least, Tripoli is calm at the moment, with no air strikes by the forces of General Khalifa Haftar, based in the east and backed by the Tobruk government, for several weeks now.

As in most of the government departments, the atmosphere was relaxed around the Prime Minister’s offices in Tripoli with little sign of overt security. Mr Ghweil, an engineer by profession, is from the city of Misrata, as are most of his officials.

Fighters from Misrata are confronting Isis in Sirte where there has been a series of skirmishes but, as yet, no decisive battle. Sitting in his relatively simply furnished office, Mr Ghweil held that Isis in Libya is the creation of former Gaddafi loyalists. “Yes they are extremists, and they are from the old regime. Ahmed Gaddafi al-Dam [cousin of Colonel Gaddafi] has admitted as much on television saying he supported them. The aim is to damage Libya, but we will defeat Daesh”.

Khalifa al-Ghweil blames Gaddafi loyalists in Isis for trying to damage Libya (AFP/Getty)

A more destructive threat to Libya, held the Prime Minister, came from General Haftar. “The man is a war criminal: we have a warrant out for his arrest. He has been responsible for destroying Benghazi. His troops have killed many innocent people,” he stated.

The two rival governments have been holding talks in Morocco brokered by the UN envoy Bernardino Leon towards holding fresh elections and a national government. A supposed breakthrough in April foundered after Gen Haftar’s jets targeted Tripoli’s Mitiga airport as a plane carrying a Libya Dawn delegation was taking off. It was, said Mr Leon, an attempt to sabotage the talks.

“We are committed to the peace plan and hopefully something will be achieved soon. But they [Tobruk] are supporting this criminal who is causing so much damage and also someone who is asking foreign countries to interfere. That is a betrayal of our country,” said Mr Ghweil.

The question of the involvement of foreign countries takes Libya into the realpolitik of the Middle East. Egypt and the United Arab Emirates are against some of the Islamist factions backing the Tripoli government.

Their warplanes carried out strikes against Islamist forces, including those in Tripoli, last year. The air strikes were followed by bomb attacks against the embassies of the two countries. Shipments of arms, ammunition and armoured cars are reported to have been delivered to Gen Haftar since then.

Mr Ghweil maintained that his government would welcome interaction with the West. “We need its involvement, but it certainly would not help if this involvement meant bombing boats because Europe thinks that will stop smuggling. It will not and if Europe comes to our water and land without permission we will, as I said, defend ourselves,” he said.