SARISSKE MICHALANY, Slovakia — Gazing out his window during morning recess on his first day at work, the principal of an elementary school here, Jaroslav Valastiak, was caught up short: all the children playing in the asphalt-covered yard were white, a strikingly monochromatic scene at a school where a majority of pupils are dark-skinned Roma.

The Roma children, he then discovered, had all been shepherded into a separate, Roma-only playground.

Lunchtime brought another shock. The school canteen served only white children, with Roma pupils left outside with bagged rations, instead of hot food. Classes were also divided, officially on the basis of academic aptitude, but in a manner that ended up grouping students along rigid ethnic lines.

“The segregation here was as obvious as fireworks,” Mr. Valastiak said.

The 59-year-old principal has spent the past year trying to break down barriers, both physical and mental, in a painful struggle for integration that some here say echoes that of the United States more than a half-century ago.