U.S. President Donald Trump (C) signs an Executive Order establishing extreme vetting of people coming to the United States after attending a swearing-in ceremony for Defense Secretary James Mattis (R) with Vice President Mike Pence at the Pentagon in Washington, U.S., January 27, 2017. Reuters/Carlos Barria

The 9th US Circuit Court of Appeals on Thursday upheld a lower court's ruling that blocked the Trump administration from enforcing its travel ban against the grandparents and extended relatives of people in the US, and refugees with ties to US resettlement agencies.

A three-judge panel on the appeals court issued a unanimous ruling Thursday after hearing arguments last month on the scope of President Donald Trump's controversial travel ban, which the Supreme Court allowed in June to partially take effect.

According to the 9th Circuit, close family members and refugees affiliated with US resettlement agencies should not be prevented from entering the US under the ban.

"Stated simply, the government does not offer a persuasive explanation for why a mother-in-law is clearly a bona fide relationship, in the Supreme Court's prior reasoning, but a grandparent, grandchild, aunt, uncle, niece, nephew, or cousin is not," the ruling said.

Under the Supreme Court order, the Trump administration was allowed to continue enforcing its ban on refugees entering the US. But it was required to exempt certain travelers from the six named countries in the ban — Iran, Syria, Libya, Sudan, Somalia, and Yemen — who could credibly claim a "bona fide relationship with a person or entity in the United States."

The order set off confusion on what types of relationships would qualify under the exemption, and the Trump administration initially excluded relatives such as grandparents, grandchildren, aunts, uncles, nieces, nephews, and cousins.

The order also prompted controversy over the refugee-related component of the ban — some critics argued that refugees who already had ties to American refugee resettlement agencies should also be considered to have a "bona fide relationship" with an entity in the US.

A Hawaii court ruled in July that grandparents and cousins must also be considered "close familial relationships" and therefore exempt from the ban, and refugees with ties to resettlement agencies also qualified for the exemption.

"We conclude that in modifying the preliminary injunction to preserve the status quo, the district court carefully and correctly balanced the hardships and the equitable considerations as directed by the Supreme Court," the 9th Circuit ruling on Thursday said.

According to media reports, all three judges on the 9th Circuit panel who issued Thursday's ruling had been skeptical during the hearing last month of the Trump administration's argument that grandparents and other extended relatives could be excluded from the definition of a "close familial relationship."

"How can the government take the position that a grandmother or a grandfather or aunt or uncle of a child in the US does not have a close familial relationship? Like, what universe does that come from?" Judge Ronal Gould said at the hearing, Politico reported.

The Trump administration responded that a narrow definition of "close familial relationship" would be simpler to administer and was supported by immigration law.

"The government doesn't dispute that many people have a profound connection with their grandparents," Justice Department attorney Hashim Mooppan said. "That doesn't mean that for a legal definition of 'close family' that that would count, and Congress themselves have recognized that."

The Supreme Court is set to hear arguments on the ban in October.