Immigration officials are illegally incarcerating asylum-seekers for months at a time, according to a new lawsuit brought by advocacy groups.

In the latest challenge to the Trump administration’s immigration policies, a group of immigrants who were detained after requesting asylum filed a class action lawsuit arguing they should be paroled while their cases are decided.

Among the plaintiffs, who have been incarcerated for stretches ranging from four months to nearly a year and a half, are people from Haiti, Venezuela and Cuba fleeing political persecution; a Honduran man fleeing “harassment, assault, and threats at gunpoint” because he is gay; and El Salvadorans who faced death threats from gangs, according to a complaint.

“More than a thousand individuals in the last year have been unlawfully deprived of their liberty for nothing more than seeking refuge in a nation that has provided it to countless others since its founding”, said a complaint submitted by a group of organisations that include the American Civil Liberties Union and Human Rights First.

The complaint alleges that five Immigration and Customs Enforcement (ICE) field offices, acting on direction from headquarters, have detained “virtually all adults” seeking asylum in an effort to “deter other migrants from seeking refuge here”.

All of the plaintiffs in the lawsuit were determined to have a credible fear of persecution if returned home - the legal standard for winning asylum - clean criminal records and sponsors willing to house them, the lawsuit says.

Protestors rally at JFK Airport against Muslim immigration ban Show all 20 1 /20 Protestors rally at JFK Airport against Muslim immigration ban Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-1 Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-2 Protestors rally during a protest against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump singed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-3 Protestors rally during a protest against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump singed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-4 SAN FRANCISCO, CA - JANUARY 28: Demonstrators hold signs during a rally against a ban on Muslim immigration at San Francisco International Airport on January 28, 2017 in San Francisco, California. President Donald Trump signed an executive order Friday that suspends entry of all refugees for 120 days, indefinitely suspends the entries of all Syrian refugees, as well as barring entries from seven predominantly Muslim countries from entering for 90 days. Stephen Lam/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-5 A crowd of protesters gathers outside of the Brooklyn Federal Courthouse as a judge hears a challenge against President Donald Trump's executive ban on immigration from several Muslim countries, on January 28, 2017 in Brooklyn. The judge issued an emergency stay on part of Trump's executive order, ruling that sending refugees stopped at U.S. airports back to their countries would be harmful. Yana Paskova/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-6 Protestors rally during a demonstration against the new immigration ban issued by President Donald Trump at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-7 NEW YORK, NY - JANUARY 28: Protestors rally during a demonstration against the new immigration ban issued by President Donald Trump at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-8 Protestors rally during a demonstration against the new immigration ban issued by President Donald Trump at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-9 NEW YORK, NY - JANUARY 28: Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. (Photo by Stephanie Keith/Getty Images) Getty Images Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-10 NEW YORK, NY - JANUARY 28: Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. (Photo by Stephanie Keith/Getty Images) Getty Images Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-11 NEW YORK, NY - JANUARY 28: Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-12 Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-13 Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-14 Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-15 Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-16 Protestors rally during a demonstration against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump signed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-17 NEW YORK, NY - JANUARY 28: Protestors rally during a protest against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump singed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-18 Protestors rally during a protest against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump singed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-19 Protestors rally during a protest against the Muslim immigration ban at John F. Kennedy International Airport on January 28, 2017 in New York City. President Trump singed the controversial executive order that halted refugees and residents from predominantly Muslim countries from entering the United States. Stephanie Keith/Getty Protestors rally at JFK Airport against Muslim immigration ban jfk-protest-muslim-ban-20 Passengers wait in line to check in at the American Airlines terminal at JFK International Airport August 10, 2006 in the Queens borough of New York City. British authorities arrested 21 people and halted a anallegedly terrorist plot to use liquid explosives concealed in carry-on luggage to blow up airliners traveling between Britain and the U.S. Homeland Security chief Michael Chertoff said that the plot appeared to be directed at U.S. carriers flying out of Heathrow. such as United Airlines, American Airlines, Continental Airlines. Stephen Chernin/Getty

It argues that their detentions violate a 2009 directive saying immigration agents should parole asylum-seekers who have credible cases, do not pose a flight risk and can confirm their identities because their “continued detention is not in the public interest”.

A Department of Homeland Security spokesperson said in a statement that immigration officers had the authority to make case-by-case parole decisions.

“Congress was clear when it provided the legal framework for asylum, including credible fear claims”, spokesperson Katie Waldman said. “That framework authorizes the detention of illegal aliens who claim credible fear, even if they initially satisfy the threshold screening”.

Pilots stop 222 asylum seekers being deported from Germany by refusing to fly

Trump administration officials have argued overly lenient asylum rules are encouraging illegal immigration. Acting Commissioner of US Customs and Border Protection Kevin McAleenan warned Donald Trump during a White House meeting last month that more immigrants were claiming asylum at ports of entry, seeking to exploit “congestion in the asylum and immigration court processes”.