LOS ANGELES — A federal appeals court on Thursday reopened the country’s door to thousands of refugees who had been temporarily blocked by President Trump’s travel ban, and also upheld a lower court decision that had exempted grandparents and other relatives from the ban.

The ruling, from the United States Court of Appeals for the Ninth Circuit in Seattle, was cheered by refugee resettlement organizations, and clarified, for now, who was covered by the ban.

In June, the Supreme Court allowed parts of President Trump’s executive order temporarily barring all travelers from six predominantly Muslim countries, and all refugees, to take effect while the court considered arguments over whether such a ban was constitutional. But the court said the government should let in travelers and refugees with a “bona fide relationship with a person or entity in the United States,” without fully defining what that meant.

The administration defined it as immediate family members and in-laws, but not grandparents, cousins, aunts and uncles. It also excluded refugees whose only tie to the United States was to the resettlement agency that was working to bring them into the country.