A court decision on President Donald Trump's travel ban has reopened a window for tens of thousands of refugees to enter the United States, and the government is looking to quickly close it.

The administration said on Friday it would appeal directly to the US Supreme Court after a federal judge in Hawaii ordered it to allow in refugees formally working with a resettlement agency in the United States.

US District Judge Derrick Watson also vastly expanded the list of US family relationships that refugees and visitors from six Muslim-majority countries can use to get into the country, including grandparents and grandchildren.

The ruling was the latest twist in a long, tangled legal fight that will culminate with arguments before the nation's high court in October.

It could help more than 24,000 refugees who had already been vetted and approved by the US but would have been barred by the 120-day freeze on refugee admissions, said Becca Heller, director of the International Refugee Assistance Project, a resettlement agency.

"Many of them had already sold all of their belongings to start their new lives in safety," she said. "This decision gives back hope to so many who would otherwise be stranded indefinitely."

Citing a need to review its vetting process to ensure national security, the administration capped refugee admissions at 50,000 for the 12-month period ending 30 September, a ceiling it hit this week.

The federal budget can accommodate up to 75,000 refugees, but admissions have slowed under Mr Trump, and the government could hold them to a trickle, resettlement agencies say.

Donald Trump blast "judicial overreach" as Hawaii judge blocks travel ban

"Absolutely this is good news for refugees, but there's a lot of uncertainty," said Melanie Nezer, spokeswoman for HIAS, a resettlement agency. "It's really going to depend on how the administration reacts to this."

Attorney General Jeff Sessions said the administration will ask the Supreme Court to weigh in, bypassing the San Francisco-based 9th US Circuit Court of Appeals, which has ruled against it in the case.

The Supreme Court allowed a scaled-back version of the travel ban to take effect last month.

"Once again, we are faced with a situation in which a single federal district court has undertaken by a nationwide injunction to micromanage decisions of the co-equal executive branch related to our national security," Mr Sessions said.

"By this decision, the district court has improperly substituted its policy preferences for the national security judgments of the executive branch in a time of grave threats."