Finally, in 2005, after the collapse of the Soviet Union and under pressure from residents and international attention, the Ukrainian and Slovakian governments allowed a pedestrian-only crossing to be cut through the fence.

And then came, perhaps, the strangest twist of all.

Since Slovakia is a member of the European Union, its citizens can travel into Ukraine — which is eager to get closer to Europe — simply by presenting a passport. But citizens of Ukraine must still get a visa, which takes weeks and is, at $38, beyond the means of many.

At the same time, prices for most consumer goods are considerably cheaper in inflation-choked Ukraine. So shoppers from Velke Slemence and other nearby Slovakian towns poured through the new border gate in search of bargains, transforming the little town into something like an outlet center, while Ukrainians faced much greater hurdles to get into Slovakia.

The result is that shops in Slovakia, where the national economy is considerably more robust, have withered, and almost the entire commercial life of the area has shifted to the crumbling Ukrainian side.

“Today, there are only three shops in all of Velke Slemence,” said the village’s mayor, Ludovit Toth. “In Mali Selmentsi, there are 30.”

In the first years after the gate opened, more than 1,000 people a day passed through, some to visit long-lost relatives but most to shop. The number of stores rose to more than 70.