Increased fighting in Libya has forced the U.S. to temporarily relocate a number of its troops from the country as conditions deteriorate, officials said Sunday.

U.S. Africa Command said in a news release that a contingent of U.S. forces supporting U.S. Africa Command has pulled out due to "security conditions on the ground."

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

RIVAL LIBYAN FORCES SAY THEY HAVE CAPTURED TRIPOLI AIRPORT

Waldhauser did not provide details on the number of U.S. troops that have been withdrawn or on how many remain inside the country. Photos and videos posted to Twitter appear to show some of the U.S. troops evacuating near Tripoli.

Officials have told Fox News that hundreds of American troops had been in Libya in recent years helping the U.N.-backed government combat Islamic State and Al Qaeda militants.

Troops also protect diplomatic facilities in the wake of the deadly 2012 attack on a U.S. diplomatic compound and CIA annex in Benghazi, Libya, that killed 4 Americans, including Ambassador Chris Stevens.

A renegade Libyan general has started an assault on the capital of Tripoli in recent days, targeting the airport located outside the city.

Libyan militia commander General Khalifa Hifter meets with Russian Foreign Minister Sergei Lavrov in Moscow, Russia, in August 2017.

Libyan militia commander General Khalifa Hifter meets with Russian Foreign Minister Sergei Lavrov in Moscow, Russia, in August 2017. (AP Photo/Ivan Sekretarev)

Fighting was underway Sunday at the international airport about 15 miles from central Tripoli, after the Libyan National Army, led by Field Marshal Khalifa Hifter, claimed to have seized the area. The airport was destroyed in a previous bout of militia fighting in 2014. Hifter said his forces had launched airstrikes targeting rival militias on the outskirts of Tripoli.

Libya has been gripped by unrest since the 2011 uprising that overthrew and killed long-ruling dictator Muammar Qaddafi, and in recent years has been governed by rival authorities in the east and in Tripoli, in the west, each backed by various armed groups.

A senior State Department official told Fox News that the Trump administration has made clear its "deep concern" about fighting near Tripoli, adding there is "no military solution" to the Libya conflcit.

"The United States opposes the military offensive by Khalifa Haftar’s forces and urges the immediate halt to all military operations against Tripoli, and return to status quo positions," the official told Fox News. "All involved parties should urgently de-escalate the situation, which is endangering civilians and undermining prospects for a better future for all Libyans."

GERMAN AID GROUP SAYS 64 MIGRANTS RESCUED AT SEA OFF LIBYA

The rival militias, which are affiliated with a U.N.-backed government in Tripoli, said they had also carried out airstrikes that slowed Hifter's advance. At least 23 people, including civilians, have been killed on both sides since Thursday.

The Interior Ministry of the Tripoli-based government said in a statement to the Associated Press that at least 9 people, including a physician, were killed. It said at least 55 fighters and a civilian were wounded.

Ahmed al-Mesmari, a spokesman for Hifter's forces, said Saturday that 14 troops had been killed since the offensive began.

CLICK HERE FOR THE FOX NEWS APP

The fighting has displaced hundreds of people, the U.N. migration agency said. The U.N. mission to Libya has called for a two-hour cease-fire on Sunday in parts of Tripoli to evacuate civilians and wounded people.

The LNA is supported by Egypt, the United Arab Emirates, France and Russia. It answers to the authorities based in eastern Libya, who are at odds with the U.N.-backed government.

Fox News' Rich Edson and The Associated Press contributed to this report.