Mayor Bill de Blasio went to Washington Heights in Upper Manhattan on Sunday to talk about international relations. The topic could hardly have been closer to home for the neighborhood, the center of the Dominican community in New York City.

The government of the Dominican Republic has been criticized for threatening to deport undocumented migrant workers, most with roots in neighboring Haiti. In his remarks, the mayor joined the critics.

“It is clearly an illegal act, it is an immoral act, it is a racist act by the Dominican government,” he said to the dozens of people gathered at the Malcolm X and Dr. Betty Shabazz Memorial and Education Center. “And it’s happening because these people are black,” he added.

In New York, many Dominican leaders have stood in solidarity with Haitian leaders. But if the mayor was expecting to be cheered, he found himself assailed by Dominicans who disagreed with him.