U.S. District Court Judge Michael H. Simon opened a hearing to consider a temporary restraining order against the federal government by quoting President Donald Trump.

"We cannot allow all of these people to invade our Country. When somebody comes in, we must immediately, with no Judges or Court Cases, bring them back from where they came," Simon read from a tweet the President posted last night. He noted that the Department of Homeland Security recognizes tweets by the president as official statements from his office.

"What am I to make of that?" Simon asked the government's lawyer.

It was a contentious start to a hearing that ended with an order mandating that U.S. Immigration and Customs Enforcement and Federal Bureau of Prisons officials immediately take steps to ensure immigration detainees held in a prison in Sheridan, Ore. have access to attorneys.

The Innovation Law Lab, a nonprofit that has volunteered to provide legal services to the 123 men who have been detained in the Oregon prison on immigration charges, filed an emergency motion for the temporary restraining order last week. The American Civil Liberties Union of Oregon joined the case to argue that the federal government had denied detainees their civil rights.

The Federal Public Defenders office in the district of Oregon filed a "friend-of-the-court" brief detailing the conditions for immigration detainees in the prison. Lisa Hay, the state's chief federal public defender, told the court that 123 people, including some teenagers, had been detained in the federal prison with little access to outside communication.

She said her office wants to file petitions to have the detainees released from custody, but it will not do so until the immigrants have a chance to consult with immigration attorneys about how such a petition might impact their asylum claims.

Innovation Law Lab's attorneys asked the court to mandate that at least two rooms be provided for six hours each day so that immigration lawyers can meet with the detainees who want legal counsel. They also asked for additional phone access within the prison and mandatory "Know Your Rights" classes before any detainees undergo a "credible fear" interview, the first step in the asylum process.

The government's lawyer argued that the federal prison in Sheridan is already implementing many of these requests and will have almost all of them in place by July 7.

"If I take them at face value, and at this point I do, the government is trying to go in the right direction," he said. "Trust, but verify. I do trust the government, but part of their presentation is that these things will happen."

Simon asked the defense if it was possible that the detainees could be deported without an asylum hearing or immigration proceeding in court. The government's attorney said that would not happen.

Despite arguments from the defense that his court lacked jurisdiction, Simon issued a temporary restraining order that required at least four phone lines that could call out to legal services from 8 am to 8 pm, or during the facilities' "awake" hours.

He required the federal agency to provide "Know Your Rights" sessions to all detainees, offer individual meetings with attorneys at detainees' requests, and delayed any credible fear interviews or deportations prior to detainees having access to a "Know Your Rights" class and a full consultation with an attorney if requested. He also barred federal officials from transferring detainees to evade the order, and required court oversight to move detainees to new facilities.

"We are a nation under law, the rule of law is one of our most cherished values," Simon said as he concluded the hearing. He set a follow-up hearing to amend the temporary restraining order on July 2 at 10 am.