SEATTLE — A federal appeals court on Thursday rejected the Trump administration’s limited view of who is allowed into the United States under the president’s travel ban, saying grandparents, cousins and similarly close relations of people in the U.S. should not be prevented from coming to the country.

The unanimous ruling from three judges on the 9th U.S. Circuit Court of Appeals also said refugees accepted by a resettlement agency should not be banned. The decision upheld a ruling by a federal judge in Hawaii who found the administration’s view too strict.

READ MORE: Feds appeal judge’s travel ban ruling to Supreme Court

“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.

The U.S. Supreme Court said in June that President Donald Trump’s 90-day ban on visitors from Iran, Libya, Somalia, Sudan, Syria and Yemen can be enforced pending arguments scheduled for October. But the justices said it should not apply to visitors who have a “bona fide relationship” with people or organizations in the U.S., such as close family ties or a job offer.

The government interpreted such family relations to include immediate family members and in-laws, but not grandparents, cousins, aunts and uncles. The judge in Hawaii overruled that interpretation, expanding the definition of who can enter the country to the other categories of relatives.

The Hawaii judge also overruled the government’s assertion that refugees from those countries should be banned even if a resettlement agency in the U.S. had agreed to take them in.

Lawyers for the government and the state of Hawaii, which challenged the travel ban, argued the case in Seattle last week.

Deputy assistant attorney general Hashim Mooppan ran into tough questions as soon as he began arguing the government’s case, with Judge Ronald Gould asking him from “what universe” the administration took its position that grandparents don’t constitute a close family relationship.

Judge Richard Paez similarly questioned why an in-law would be allowed in, but not a grandparent.

“Could you explain to me what’s significantly different between a grandparent and a mother-in-law, father-in-law?” Paez asked. “What is so different about those two categories? One is in and one is out.”

Mooppan conceded that people can have a profound connection to their grandparents and other extended relatives, but from a legal perspective, the administration had to draw the line somewhere to have a workable ban based largely on definitions used in other aspects of immigration law, he said.

READ MORE: The Supreme Court just had a quiet term. These high-profile cases are about to change that.