A group of US commandos who had traveled to Libya to "foster relationships" was ordered to leave the war-torn country soon after they arrived, the Pentagon says.
A Facebook page belonging to the Libyan air force has revealed the secret US mission by posting photographs of US Special Operations Forces troops in Libya. The men were dressed in rugged civilian clothing, including plaid shirts, and were carrying assault rifles.
A Pentagon official, speaking on condition of anonymity, confirmed on Thursday that the men in the photographs were indeed American troops in Libya.
The troops were in Libya "with the concurrence of Libyan officials," the official added.
"US military personnel traveled to Libya on December 14 to foster relationships and enhance communication with their counterparts in the Libyan National Army," the official said.
"While in Libya, members of a local militia demanded that the US personnel depart. In an effort to avoid conflict, they did leave, without incident."
More than four years after the overthrow of long-time dictator Muammar Gaddafi, Libya is still grappling with rising insecurity as the country has been witnessing numerous clashes between government forces and rival militia groups.
The former rebels refuse to lay down arms despite efforts by the central government to impose law and order.
In 2012, a terrorist attack at the US diplomatic compound in Benghazi left four US diplomats, including Ambassador Chris Stevens, dead.
According to CNN, up to 35 CIA operatives were working in Benghazi during the attack on September 11, 2012, but it has never reported how many of them died or were injured.