Updated at 2:20 p.m. ET

A federal judge in Hawaii has put new limits on the Trump administration's travel ban on people from six mostly Muslim countries. The judge is allowing entry by grandparents, grandchildren, and other family members of people in the United States.

In an order issued late Thursday, Federal District Court Judge Derrick Watson also found that any refugees with ties to resettlement agencies in the U.S. that are preparing to receive them should be exempt from the travel ban.

It's another legal setback for an executive order that's been tied up in court for months. Attorney General Jeff Sessions says the administration will ask the U.S. Supreme Court to void the judge's ruling.

The Supreme Court ruled in June that a scaled-back version of the ban on people seeking to travel here from Iran, Libya, Somalia, Sudan, Syria and Yemen could proceed. But the high court said it could not be enforced against those who have a "bona fide relationship" with people in the U.S.

The Trump administration said that would include parents, spouses, fiances, sons, daughters, sons-in-law, daughters-in-law or siblings. But the government excluded grandparents and grandchildren from its definition of "close family," along with brothers-in-law, sisters-in-law, aunts, uncles, nieces, nephews and cousins.

In his ruling, Judge Watson did not accept the administration's distinction.

"[T]he Government's definition represents the antithesis of common sense," Watson wrote. "Common sense, for instance, dictates that close family members be defined to include grandparents. Indeed, grandparents are the epitome of close family members. The Government's definition excludes them. That simply cannot be."

Watson's order is also a win for refugee resettlement agencies. They argued that their relationship with refugees who have already been approved to travel to the U.S. should count as "bona fide" under the Supreme Court's order. Lawyers for the Trump administration argued otherwise, because the State Department acts as an intermediary until the refugee actually arrives in the U.S.

But the judge rejected the administration's argument.

"An assurance from a United States refugee resettlement agency, in fact, meets each of the Supreme Court's touchstones: it is formal, it is a documented contract, it is binding, it triggers responsibilities and obligations," Watson wrote. "Bona fide does not get any more bona fide than that."

Watson's decision could open the door for tens of thousands of additional refugees who have been approved for travel, but would have been barred from entry into the U.S under the travel ban. Earlier this week, the refugee program reached the cap of 50,000 refugees – not necessarily with family ties – for the 2017 fiscal year that was imposed by the executive order.

Thursday's ruling came in response to the state of Hawaii's request for an injunction against the Trump administration's enforcement of the ban on expanded family members and refugees.

In a statement, Hawaii Attorney General Douglas Chin said, "The federal court today makes clear that the U.S. Government may not ignore the scope of the partial travel ban as it sees fit. Family members have been separated and real people have suffered enough. Courts have found that this Executive Order has no basis in stopping terrorism and is just a pretext for illegal and unconstitutional discrimination. We will continue preparing for arguments before the U.S. Supreme Court in October."

Copyright 2017 NPR. To see more, visit http://www.npr.org/.