“We discourage them,” said Ivan Kacur, 36, a Roma who has worked for the village company for two years, cutting grass. “They have their own culture and habits. We wouldn’t want that here. I’ve got a mortgage and a new home, a real home.”

The contrast to Spissky Hrhov’s success can be seen just a few miles away in Roskovce, an illegal settlement of about 500 Roma spread along a narrow ravine.

Two outdoor water pumps serve all of Roskovce’s residents. Homes are falling down, half-finished, with gaping holes for windows and crumbling roofs. Mr. Ledecky, who is building a new school for the settlement, has hired a few of its residents, but many more are eager to join the village’s work force.

“This has really changed our community,” Mr. Ledecky said. “The majority no longer have any problem with the Roma from our village. At the same time, they do not feel the same about Roma from other villages. I can’t understand why this racism persists.”

Indeed, the success of villages like Spissky Hrhov is not welcome by everyone. As the number of Muslim refugees passing through Central Europe has dwindled, nationalists and neo-fascists have again made the Roma a target.

“They have redirected their anger against the Roma again,” said Irena Bihariova, chairwoman of People Against Racism, a human-rights group based in Bratislava, the capital. “Things neo-Nazis wouldn’t dare say in public are now being said all over the place, on Facebook, without fear.”

She pointed to a series of marches against “social parasites,” as the right-wing describes the Roma, organized by Marian Kotleba, the neo-fascist governor of the Banska Bystrica region not far from Spissky Hrhov.