STUTTGART, Germany — The U.S. military has withdrawn its troops from Libya as a local military commander’s forces advanced on the capital for a showdown with militias holding the city.

“Due to increased unrest in Libya, a contingent of U.S. forces supporting U.S. Africa Command temporarily relocated in response to security conditions on the ground,” AFRICOM said in a statement.

The command did not elaborate on the size of the troop contingent or where they were moved to. “We will continue to monitor conditions on the ground and assess the feasibility for renewed U.S. military presence, as appropriate,” said Nate Herring, an AFRICOM spokesman.

AFRICOM, which led a 2016 bombardment campaign to dislodge Islamic State elements in the country, has maintained a special operations mission inside Libya that assists the government in counterterrorism efforts.

AFRICOM’s concern over the “evolving security situation” comes amid an offensive by the renegade general, Khalifa Hifter, whose forces are making an attack on the Libya capital of Tripoli. Various media reports say Hifter’s troops have made inroads and seized control of Tripoli International Airport.

“The security realities on the ground in Libya are growing increasingly complex and unpredictable,” said U.S. Marine Corps Gen. Thomas Waldhauser, commander, U.S. Africa Command. “Even with an adjustment of the force, we will continue to remain agile in support of existing U.S. strategy.”

There is widespread concern that Hifter’s military push will bring on another wave of violence and fighting in a country that has operated as a virtual failed state since the 2011 overthrow of longtime dictator Moamar Gadhafi.

In Libya, the U.S. backs a United Nations-recognized government. However, the central government has struggled to assert itself in a country where numerous militias have long vied for power in carved-out enclaves.

Hifter leads the so-called Libyan National Army, which already control swaths of territory in country’s oil-rich coastal areas.

Ironically, Hifter was once viewed as a creation of the U.S. The Americans negotiated his release from Moammar Gadhafi’s prison in 1990 and brought him to the U.S., where he settled in Langley, Va., close to CIA headquarters. He returned to Libya in 2011 and joined the uprising against Gadhafi — widely seen as America’s man in the opposition.

In the years since, he has fought for control and also made overtures to Moscow, cultivating a relationship with top Russian officials. That relationship has been a source of concern for U.S. military leaders.

AFRICOM said its mission in Libya “involves military support to diplomatic missions, counter-terrorism activities, enhancing partnerships, and improving security across the region.”

So far, the Libyan government has not asked AFRICOM for military support to help fend off Hifter’s offensive.

“U.S. Africa Command has conducted air strikes in Libya against terrorist organizations, however, I reiterate that we have not been requested to provide any military support to our Libyan partners at this time,” Becky Farmer, an AFRICOM spokeswoman, said late Friday. “That said, we remain committed to a secure and stable Libya, which benefits regional security.”

vandiver.john@stripes.com

Twitter: @john_vandiver