A Brooklyn federal judge on Thursday extended a restraining order prohibiting removals of any noncitizens under President Donald Trump’s controversial executive order last week that restricted visas and entries from citizens of seven majority-Muslim countries.

U.S. District Judge Carol B. Amon said the restraining order imposed by a fellow judge Saturday night after border agents began detaining and sending back green-card and visa holders was set to expire on Feb. 11. Amon extended it until Feb. 21 to give both sides more time to address the merits.

“There needs to be some extension if we’re going to have this adequately briefed,” Amon said.

Two Justice Department lawyers at the hearing said no one was being detained any longer under the order, but the immigration attorneys who filed suit complained that they’ve never received a court-ordered list of everyone detained to monitor compliance, and still suspect there have been detentions and removals since Saturday.

Amon told the two sides to try to work out the dispute, but American Civil Liberties Union lawyer Lee Gelernt said after the hearing that he would press for quick compliance. “If they don’t give us the information, we’ll make an application to the judge,” he said.

Trump’s order prohibited visas or entry for 90 days from Sudan, Syria, Yemen, Iran, Iraq, Libya and Somalia. The administration said it wanted to put new procedures in place to identify terrorists. It also prohibited refugees from Syria indefinitely, and from the other six countries for 120 days.

advertisement | advertise on newsday

Since it was first issued, the administration has said it wouldn’t be applied to green card holders. The lawsuit contends that it is unconstitutional because it singles out Muslims and violates immigration statutes, and has been implemented by pressuring arriving visitors to waive their rights and give up visas to avoid detention or forcible long-term removal.

On Thursday, New York Attorney General Eric T. Schneiderman became the latest state attorney general to seek to join the action by filing a petition with Amon asking to participate in the federal case. Amon took it under advisement.

In legal filings, Schneiderman’s office said Trump’s restrictions would create “profound” harm for New York by restricting or banning immigrants who contribute to the state’s economy, and argued it would hurt New York in the high-technology, medical and financial sectors.

Schneiderman, a Democrat, said in a statement that the order was “unconstitutional and fundamentally un-American.”

“President Trump’s intent to discriminate against Muslims is clear,” Schneiderman said. “We will continue to use every tool at our disposal to fight this discriminatory ban and protect all those caught in the crossfire of its chaotic implementation.”