Foreigners in Libya have increasingly been subjected to human rights abuses since the overthrow of Moammar Gadhafi last year, according to a new report from Amnesty International.

“In a prevailing atmosphere of lawlessness, racism and xenophobia, undocumented foreign nationals in Libya are at continuous risk of exploitation, arbitrary and indefinite detention in harsh conditions, as well as beatings, sometimes amounting to torture,” the report reads.

Amnesty notes the many abuses carried out under the Gadhafi regime, but said foreign nationals, particularly from sub-Saharan Africa, are being targeted by militias due to the widespread belief that they served as mercenaries for Gadhafi during the 2011 uprising.

“The Libyan authorities must acknowledge the extent of the abuse by militias and put in place measures to protect all foreign nationals from violence and abuse, regardless of their origin or immigration status,” Amnesty International Middle East and North Africa Deputy Director Hassiba Hadj Sahraou said in a statement.

“The authorities must also take concrete measures to tackle racism and xenophobia head-on, especially considering how heavily Libya relies on migrant labor.”

Many of the people being targeted come from African countries like Chad, Ethiopia, Eritrea, Somalia and Sudan, and are often fleeing conflict or searching for better economic opportunities, according to Amnesty.

“The Libyan authorities and militias do not make a distinction between migrants, asylum-seekers and refugees,” Amnesty said.

“Because of their irregular status, individuals in need of international protection are similarly at risk of arbitrary arrest, indefinite detention and torture or other ill-treatment.”

Refugees are particularly vulnerable as Libya does not have a functional asylum system, and has refused to sign a memorandum of understanding with the U.N. Refugee Agency.

According to the report, some 4,000 foreign nationals were deported from Libya between January and September 2012 without any consideration of their refugee claims.