ISTANBUL — Turkey’s foreign ministry said Sunday that six of its citizens had been detained in Libya by militias loyal to the powerful military commander Khalifa Hifter, and warned that Hifter’s forces would become “legitimate targets” if the Turks were not released.

Later Sunday, forces loyal to Hifter said they destroyed a Turkish drone parked at Tripoli’s only working airport and declared a “general mobilization,” the news agency Reuters reported.

The events threatened to further inflame Libya’s precarious and violent civil conflict. Hundreds of people have been killed in recent months during some of the worst fighting in Libya since the revolt that toppled Moammar Gaddafi in 2011.

It was the latest sign of the deepening proxy war in Libya between rival foreign powers, including Turkey and the United Arab Emirates, which have competed for influence around the Middle East since the revolts of the Arab Spring eight years ago.

 Hifter, a former general in Gaddafi’s army, is commander of the self-proclaimed Libyan National Army and aligned with a government operating in eastern Libya. In April, he launched an offensive on Tripoli, the Libyan capital, aimed at ousting the U.N.-backed government there.

 Several foreign countries have violated an international arms embargo on Libya, according to U.N. investigators. Hifter has received materiel and direct military support from the U.A.E. and Egypt; Turkey has recently provided armed drones and armored vehicles to the U.N.-backed government.

Qatar also supports the U.N.-backed government, while France, Russia and Saudi Arabia have backed Hifter’s forces.

 The Trump administration has sent mixed signals about Hifter’s campaign: While the United States officially supports the U.N.-backed government, President Trump appeared to endorse Hifter’s offensive during a phone call with the Libyan commander in April.

 Hifter’s offensive scuttled an intensive international effort to reconcile the warring sides, resulting in a bloody stalemate. His forces suffered a surprise defeat last week in Gharyan, about 60 miles south of Tripoli and a city that served as the staging ground for his LNA’s attack on the capital.

Hifter’s forces blamed the defeat on Turkish military assistance to the U.N.-backed government.

 In recent days, the LNA has threatened to target Turkish airplanes or ships and arrest Turkish citizens. Earlier Sunday, Turkey’s defense minister warned that any attacks on its interests in Libya would be met with “strong retaliation,” Turkish media reported.

Hifter’s forces said they hit the drone in an airstrike on Mitiga airport, Reuters reported.

 Turkey’s threats raised the possibility that Turkey could be drawn into an intensifying military confrontation in Libya with the U.A.E. and Egypt, escalating a feud that had been confined mostly to diplomatic spats and a competition for influence.  

Egypt and the U.A.E. have regarded Hifter, a U.S. citizen and a self-styled military strongman, as a counterweight to Islamist forces in Libya supported by Qatar and Turkey.

Hifter, 75, lived for years in Northern Virginia before returning to Libya after the anti-Gaddafi revolt. His vows to stabilize the country have drawn support from many Libyans frustrated by the chaos that followed the NATO-led intervention that removed Gaddafi from power in 2011.   

But his offensive on Tripoli has opened a troubling new chapter of violence in the country, with heavy weaponry menacing the capital and fighting that has threatened to spill into neighboring countries.

The United Nations’ special envoy to Libya, Ghassan Salame, warned that the fighting could lead to the permanent division of the country. And recent attacks in Libya by a local affiliate of the Islamic State group suggest the militants might be taking advantage of Libya’s latest instability to regroup.

Sudarsan Raghavan in Cairo contributed to this story.