Turkey, America’s erstwhile NATO ally, is now arming America’s enemies in Libya, a flagrant violation of the 2011 United Nations arms embargo.

The clearest evidence of Turkey’s violation of U.N. embargoes came in the hold of a Turkish-crewed ship named “Amazon.” It delivered some 20 Turkish-made armored vehicles, known as “MRAPs,” the military news website South Front reported. A local blogger photographed the armored vehicles on the dock.

If Libya’s Government of National Accord prevails, it will impose Sharia law, cow and corrupt the press, socialize the economy, and open a safe haven for terrorists.

Turkey supports Libya’s Government of National Accord holed up in Tripoli. Qatar and, seemingly, Iran also back it. If it prevails, its government will impose Sharia law, corrupt the press, socialize the economy, and open a safe haven for terrorists.

America backs General Khalifa Haftar’s Libyan National Army, which commands a large swathe of eastern Libya. Gen. Haftar’s promises an Egypt-style government, if he wins. That means basic human rights, rule of law, a semi-free press, and regular elections that are usually won by the ruling party. And a new ally in the war on terror. America’s security is often strengthened by such hard compromises with its principles, leaving many Americans uneasy. This is an alliance that makes sense. Mainly because all of the realistic alternatives are far worse.

Gen. Haftar was once a high-ranking official in Muammar Gadhafi’s regime. He defected, worked with the CIA, and spent the better part of two decades living in the northern Virginian suburbs before returning to his homeland a few years ago. His forces are large, broadly disciplined, and well equipped.

So far Haftar’s army has easily swept away all opposition in their path.

Yet Tripoli may be beyond its grasp. Urban warfare is the opposite of fast-moving desert campaigns. It is usually a house-to-house proposition in which defenders make invaders pay for yards gained… in lives lost.

Turkish armor will either lengthen the war and widen the death toll or, worse, prevent the war’s end by enforcing a murderous stalemate.

Civilians are often murdered, maimed, or raped by one side or the other. Some join the resistance, becoming human bombs or amateur snipers. Even corpses are boobytrapped with explosives. Tripoli is a humid Stalingrad.

Haftar’s forces arrived in April. Almost two months later, it controls less than half of the city.

In this urban battleground, Turkish-supplied armor makes a big impact. America used similar vehicles to clear the Baghdad airport road of dug-in insurgents in 2005. Turkish armor will either lengthen the war and widen the death toll or, worse, prevent the war’s end by enforcing a murderous stalemate. Without aircraft or armor of its own there is little Haftar’s soldiers can do.

Ignoring or withdrawing from Libya is not a realistic option. A failed state on the Mediterranean would soon become a transit point of millions of refugees onward to Europe. As the Syrian refugee wave taught us, Europe can quickly be destabilized, both economically and politically, by migrants.

Turkey has broken its longtime alliance with Israel, helped Iran evade U.S. sanctions, and now aids America’s battlefield enemies.

The new “nationalist” or nativist parties would surge, while crime and poverty climb. Landing one million more North Africans would also boost Europe’s unemployment rates, which are at double digits in some places. The cultural chasm between secular Europeans and observant Muslims would provoke riots, as we have already seen in Germany. Even if the U.S. wanted to sit Libya out, the Europeans would not agree.

What is Turkey’s future as part of America’s most important military alliance, NATO? Long governed by the Islamist AKP, Turkey has broken its longtime alliance with Israel, helped Iran evade U.S. sanctions by trading with it, and now, in Syria and Libya, aids America’s battlefield enemies.

There is no treaty mechanism to painlessly expel Turkey from NATO. Besides, it supplies the second-largest contingent of ground troops in the alliance – more than Britain and France combined. Asking the Turks to leave may not be wise.

President Trump’s willingness to use tariffs could play a helpful role.

Yet neither would be ignoring Turkish antagonism.

President Trump’s willingness to use tariffs could play a helpful role. He imposed onerous tariffs on Turkey before, to spring a U.S.-born pastor from Turkish prison. Using that tool again may dissuade the Turks from arming America’s enemies – before such behavior hardens into habit.

Richard Miniter is an investigative journalist and bestselling author.