Extended family members of US citizens cannot be banned from the US under President Donald Trump's executive order, which aims to deny entry to people from six predominantly Muslim countries, a court of appeals ruled on Thursday.

After lower courts had suspended the executive order, which became known as the "Muslim ban," the Supreme Court ruled in June that the administration could proceed with it, though people with a "bona fide relationship" to a US person or entity were exempt.

But legal challenges were issued over the definition of a close relationship. The Trump administration interpreted that opinion to allow spouses, parents, children, fiances and siblings into the country, but barred grandparents and other family members in a measure Trump called necessary to prevent attacks.

But on Thursday, the 9th Circuit Court ruled that grandparents, grandchildren, cousins, aunts and uncles cannot be excluded under the ban, which applies to citizens of Syria, Iran, Yemen, Libya, Sudan and Somalia.

The appeals court also opened the door for more refugees to come into the US. A three-judge panel ruled that applicants who are already assigned resettlement cannot be covered by the ban because of their relationship with US resettlement agencies.

Late last month, 9th Circuit Court Judge Ronald Gould asked how the government could take the position that a grandmother of a child in the United States does not count as a close relationship.