The U.N.-supported government controls only a shrinking area of western Libya, including the capital, Tripoli. It's facing a months-long offensive by forces loyal to Gen. Khalifa Hifter who is allied with a rival government based in Libya's east. The United Nations recognizes the government in Tripoli, led by Prime Minister Fayez Sarraj, as Libya's legitimate government because it was born out of U.N.-mediated talks in 2015.
Sarraj is backed by Turkey, and to a lesser degree, Qatar and Italy. Hifter receives backing from the United Arab Emirates and Egypt, as well as France and Russia. Libya has the ninth largest known oil reserves in the world, and many of these countries are apparently jockeying for influence in order to control Libya's resources.
Libyan militia leaders in Tripoli told The Associated Press that Turkey has brought more than 4,000 foreign fighters into Tripoli, and that “dozens” of them are extremist-affiliated. The two commanders spoke on condition of anonymity because they were not authorized to discuss the matter with the media.
The commanders also highlighted differing opinions within the Libyan militias about accepting Syrian extremists into their ranks. One said the fighters' backgrounds aren't important, as long as they've come to help defend the capital. The other said some commanders fear the fighters will “tarnish” the image of the Tripoli-based government.
Turkey-backed militias in northern Syria have been known to include fighters that previously fought with al-Qaida, IS and other militant groups, and have committed atrocities against Syrian Kurdish groups and civilians.
The U.N. has repeatedly condemned the flow of weapons and foreign fighters into Libya. But the organization has not directly responded to reports and accusations by Hifter's side that Sarraj's government and Turkey are apparently using IS- and al-Qaida-linked extremists as mercenaries.
Turkey has not confirmed or denied reports of Syrian fighters being sent to Libya to support Sarraj, and the Turkish military did not respond to requests for comment.
However, in a televised interview last month, Turkish President Recep Tayyip Erdogan said: "As a combat force, we will have a different team there. They won't be from within our soldiers. Those different teams and the combat forces will work together. But our high-ranking soldiers will coordinate." He did not elaborate.
Rumors of Turkey-backed Syrian fighters in Libya have swirled for weeks. Foreign leaders and commentators have pointed to videos circulated online that appear to show Syrians in Tripoli. In one video, a man with a Syrian accent films the dormitories where he and other fighters are living, saying “Thank God, we arrived safely in Libya.” Another clip shows a plane full of fighters, some wearing fatigues and speaking with Syrian accents.
Turkey's Libyan allies and Syrian opposition leaders have denied any organized efforts to send combatants to Libya. But in January, Sarraj told the BBC that his government “would not hesitate to cooperate with any party to defeat this aggression" by Hifter's forces.
Rami Abdurrahman, the director of the Britain-based Syrian Observatory for Human Rights, told the AP that his war-monitoring network has determined there are at least 130 former Islamic State or al-Qaida fighters among the approximately 4,700 Turkey-backed Syrian mercenaries sent to fight for Sarraj.
He said the IS militants had joined the so-called Syrian National Army, a patchwork alliance formed by Turkey from different factions who battled the government of Syrian President Bashar Assad. Most of the groups are loyal to Turkey, and the SNA was used as shock troops last year in Turkey’s offensive against U.S.-allied Kurdish forces in northern Syria.
In theory, a cease-fire brokered by Russia and Turkey remains in place around Tripoli but Libya's warring sides have traded accusations of violations, and the shaky truce is threatened by clashes. Representatives from Sarraj and Hifter began meetings in Geneva on Tuesday to work toward a more permanent cease-fire.
The Observatory also quoted a Syrian fighter from Idlib province who applied to go to Libya as saying he was motivated by the financial benefits offered by Turkey.
Elizabeth Tsurkov, a fellow at the U.S.-based Foreign Policy Research Institute who closely follows Syria's armed groups, said the promise of payment, Turkish citizenship or the prospect of fleeing to Europe were the main motives of Syrian fighters sent to Libya.
“None of them are committed to the fight in Libya due to personal conviction or ideology,” she said.
A Libyan official at the prime minister's office said Syrian fighters have been in Libya since early August. At first, he said they were only facilitating the work of Turkish military experts. But as the fighting escalated in mid-December, the number of Syrian fighters arriving in Libya increased. These fighters now immediately deploy to the front lines, said the official, speaking on condition of anonymity because he wasn't authorized to talk to reporters on the subject.
The Tripoli authorities and U.S. officials have also accused Hifter of relying on hundreds of Russian mercenaries. Sudanese armed groups from the Darfur region recently joined the fighting on both sides, according to a report by U.N. experts.
The influx of Syrian, Russian and Sudanese mercenaries has threatened to prolong the war and cripple international efforts to establish a long-term cease-fire. Last month, a summit in Berlin brought together the major international stakeholders in Libya, but with few concrete results.
Nicholas Heras, a Syria expert at the Washington-based Institute for the Study of War, said Turkey is focusing on Libya to establish a sphere of influence in the Mediterranean.
“However, the Turks do not want to risk significant casualties to their own forces when the Turkish military has built a proxy force of Syrian fighters that can reinforce the Libyan fighters,” he said.
Associated Press writers Sarah El Deeb in Beirut and Suzan Fraser in Ankara, Turkey, contributed to this report.