“Anything that’s seen as a criticism is seen as treasonous,” he said. “We’re not the first people who have had to grapple with that.”

The Dominican Republic has for years struggled with the question of citizenship and who is entitled to it.

For decades, the government generally bestowed citizenship on anyone born in the country except those born to diplomats or foreigners “in transit.” In the 1990s, however, there was a growing practice by civil registries to interpret all undocumented Haitians as being “in transit” regardless of how long they had lived in the country, said Roxanna Altholz, associate director of the International Human Rights Law Clinic at the University of California, Berkeley.

In 2010, the Dominican Constitution was amended to define undocumented residents as “in transit,” and the recent Constitutional Court decision retroactively applied the definition to all the undocumented parents of the children born in the country since 1929, Ms. Altholz said..

The ruling is expected to affect primarily the descendants of Haitian laborers who entered the Dominican Republic to work in its sugar industry; many of those workers were actively recruited by Dominican business interests. The Dominican government said it would provide a path to legal residency for those excluded by the court ruling.

The ruling has inflamed the historically fraught relationship between the two nations, which share the Caribbean island of Hispaniola. The Haitian government recalled its ambassador to Santo Domingo in response to the ruling.

Critics of the ruling have described it as xenophobic and have said it reflects a chronic, deeply embedded racism that permeates Dominican society.