Rights groups have filed a lawsuit in a New York court to demand the release of two refugees in transit who have been detained at John F Kennedy airport.

Entry to the US for nationals of seven Muslim-majority countries has been stopped for 90 days by President Trump.

The exact implications of his order remain unclear. The US State Department has told the BBC it is working on the immediate implementation of the ban.

People fleeing Syria are banned until further notice.

The other countries affected are Iran, Iraq, Libya, Somalia, Sudan and Yemen.

The two Iraqi refugees detained in New York were in transit when the executive order was signed on Friday.

One of them, Haneed Khalid Darweesh, who had worked as a US Army interpreter, was released on Saturday afternoon.

The other man, Haider Sameer Abdulkhaleq Alshawi, remains in detention.

New York Representative Jerry Nadler tweeted that he and fellow Democratic Representative Nydia Velazquez were working to help 11 more refugees still being held.

The National Immigration Law Centre (NILC) told the BBC that it was suing President Donald Trump and the secretary of the Department of Homeland Security.

Mark Doss, a lawyer for the two Iraqis, spoke to the BBC from Terminal 4 at JFK, where he had been since Friday evening trying, and failing, to see his clients:

"It's just absolutely disgraceful that we would be turning back and detaining the most vulnerable individuals in the world – individuals who have served our country, are fleeing from persecution and have valid status, only to be detained without an attorney at their port of entry [to the US].

"And so we believe this order is unconstitutional and we will be fighting it."

Several other rights groups, including the American Civil Liberties Union (ACLU), are involved in the lawsuit, filed on Saturday morning.

On Saturday several Iraqi passengers and a Yemeni national were prevented from boarding a flight at Cairo airport bound for New York, despite holding valid visas for the US.

Mr Trump signed the order on Friday, which was International Holocaust Remembrance Day.

The president's statement to mark that occasion, on the 72nd anniversary of the liberation of Auschwitz, made no mention of Jews or anti-Semitism.

In response to Mr Trump's order, the United Nations refugee agency said the needs of those fleeing conflict had never been greater.

The Council on American Islamic Relations (CAIR) also says it will file a lawsuit.

British Prime Minister Theresa May, pressed repeatedly to give her response to Mr Trump's executive order, said: "The United States is responsible for the United States' policy on refugees."

Mrs May had told MPs on Wednesday that she would not be afraid to "speak frankly" to the new US president.

There have been reports of "green card" holders, who are legal permanent residents of the US, being prevented from getting on flights. However, green cards are not specifically mentioned in the executive order, and so the status of green card holders remains unclear.

CAIR advised non-US citizens, including permanent residents, from the seven countries to plan to delay all international travel for at least 90 days.

Mr Trump said the measures detailed in his executive order would "keep radical Islamic terrorists out of the US".

But rights groups say there is no link between Syrian refugees in the US and terrorism.

The 1951 United Nations convention on refugees is intended to offer protection to all those fleeing conflict and persecution, regardless of race, religion or nationality.

The United States has traditionally honoured its obligations under the convention with a resettlement programme: taking in individuals recommended by the UN refugee agency.

As with President Trump's suggestion that the US might reintroduce torture, the ban on refugees from certain countries is an indication that his new administration does not view international human rights law as sacrosanct.

The UN is dismayed, but apparently still hoping to engage Washington in dialogue. Respect for international law is not the only concern: the US remains one of the biggest contributors to UN aid agencies, and Donald Trump has indicated he is looking for big cuts in their budgets.

During the election campaign, Mr Trump suggested a "total and complete shutdown of Muslims entering the United States until our country's representatives can figure out what is going on".

This call was widely rejected by both Democrats and Republicans while Mr Trump remained just a candidate.

Speaker of the House of Representatives, Paul Ryan tweeted his opposition to "a religious test for entering our country" in July 2016.

On Friday, Mr Ryan, issued a statement responding to the executive order saying it was "time to re-evaluate and strengthen the visa vetting process".

"President Trump is right to make sure we are doing everything possible to know exactly who is entering our country."

Mr Trump's Vice-President Mike Pence called the proposed ban on Muslims "offensive and unconstitutional" in a tweet in December 2015.