Visitors from six predominantly Muslim nations will not be granted visas unless they have a very close family tie to someone already in the United States or an entity like a workplace or university, under new guidelines the State Department said become effective Thursday night.

A cable sent to consular officials worldwide Wednesday provided a narrow definition of close family: a parent, spouse, child, an adult son or daughter, son-in-law, daughter-in-law or sibling, as well as stepfamily relationships.

[Immigrant leaders in Maine say court travel ban ruling ‘still religious discrimination’]

However, it explicitly excluded other family relationships: grandparents, grandchildren, aunts, uncles, nieces, nephews, cousins, brothers-in-law and sisters-in-law, fiances and other “extended” family relations.

According to the cable, which was first reported by the Associated Press and posted by Reuters, the rules do not take effect until 8 p.m. Thursday, a deadline imposed to prevent people from being turned away upon arrival in the United States as happened earlier in the year when a ban was imposed affecting people already en route. The decision also affects refugees, though the cap of 50,000 refugees this fiscal year has nearly been reached, with 49,008 refugees admitted as of Wednesday.

The new rules were drawn up after the Supreme Court ruled Monday that a limited version of the travel ban could take effect until it hears the case in the fall. It said visitors with a “bona fide” relationship with a person or entity in the United States could not be barred, leading the Department of Justice and State Department to come up with instructions on who is eligible.

The travel ban is less encompassing than the executive ordered signed by President Donald Trump on March 6 barring almost all travel to the United States for people from six countries in the Middle East and Africa – Iran, Libya, Somalia, Sudan, Syria and Yemen. It allows exemptions for people coming to the United States for jobs with U.S. companies or to study or lecture at U.S. universities.

But the cable says any relationship “must be formal, documented, and formed in the ordinary course, rather than for the purpose of evading the E.O.”

After the ruling, several nonprofit groups that help resettle refugees said they might claim a “bona fide” relationship that could allow some people to be admitted who otherwise would not qualify. But the State Department cable advised consular officials not to grant an exception “to an applicant who enters into a relationship simply to avoid the E.O.: for example, a nonprofit group devoted to immigration issues may not contact foreign nationals from the designated countries, add them to client lists, and then secure their entry by claiming injury from their inclusion in the E.O.”

The cable also said a hotel reservation, paid or not, is not considered a bona fide relationship with an entity.

It was not clear how the State Department came up with its narrow definition of family, which was quickly criticized by some advocates and lawyers.

“Defining close family to exclude grandparents, cousins, and other relatives defies common sense,” said Johnathan Smith, legal director of Muslim Advocates, a civil rights group that plans to send monitors to Dulles Airport Thursday night.

Cornell University Law School professor Stephen Yale-Loehr, who has written volumes of legal books on immigration law, said more than half of all refugees have no close family ties in the United States. Among past refugees who would be barred from entering today, he said, are the Lost Boys of Sudan and children orphaned by famine and war.

“Similarly, why can a stepsister visit the United States but not a grandmother?” he said. “The State Department should vet visa applicants on a case-by-case basis for terrorism concerns, not impose overly broad categories that prevent innocent people from coming to this country.”

The directive is certain to face more legal challenges, particularly as it affects refugees.

“We have thousands upon thousands of people who are in various stages of the process,” said Eric Schwartz, head of Refugees International. “As a result of this executive order, their lives are put on hold. Instead of offering hope and opportunity to people to thrive in this country, we’re giving them the back of our hands.”

Amnesty International says it plans to send observers to airports in New York, Washington and Los Angeles to monitor how it the travel ban being implemented.

“Separating families based on these definitions is simply heartless,” said Naureen Shah, director of campaigns for Amnesty International USA, in a statement calling on Congress to end the restrictions. “It further proves the callous and discriminatory nature of Trump’s Muslim ban.”