When Haiti was hit by the devastating earthquake in 2010, its island neighbour, the Dominican Republic, rushed to help. It was among the first to send rescue workers, food and water, and also allowed overseas relief agency flights to land at Santo Domingo airport.

But three years on, the goodwill seems to have dissipated and old tensions resurfaced. Just over a week ago the Dominican Republic's highest court ruled to revoke the citizenship of children of illegal Haitian migrant workers – a measure to be applied to anyone born after 1929, and thus affecting not only migrants' children, but their grandchildren and, in some cases, even great-grandchildren.

This is the latest legal attack on the rights of Haitians and their descendants; measures in the past few years have included reclassifying migrant workers as "in transit" rather than legal residents. This meant any child born in the Dominican Republic – which had been one basis for citizenship – also needed one Dominican parent, or one who was a legal resident.

The latest ruling could leave thousands who identify themselves as Dominican but may have had a Haitian ancestor facing an uncertain future – already some 40,000 people have been told they will not receive identity documents. Without official papers, it is impossible to access services such as schools or healthcare. Human rights groups and local NGOs have expressed their concern, and the UN will be reviewing this ruling.

Haiti and the Dominican Republic share the island of Hispaniola, where Christopher Columbus established the first European settlement in 1492. Despite their shared history of colonialism and slavery, dictatorship and oppression, a physical and emotional border has long separated them.

The western third of the island was ceded by Spain to France in 1697, and the entire island by 1795. By 1801 the famed former slave General Toussaint Louverture had freed all the slaves on the island and united it under his governorship, though this was short-lived.

In 1808, a group of Dominicans started the war of reconquest to drive out the French and return the eastern part the island to Spanish rule – the west by this point was the republic of Haiti. But by 1822 Haiti had established control of the whole island once more. Indeed, the Dominican Republic gained its independence from Haiti, not Spain, in 1844.

Modern times have been no less complicated. In 1937, Dominican dictator Rafael Trujillo – who wore makeup to lighten his skin and was obsessed with "whitening" the predominantly mixed-race island – ordered the massacre of Haitians in border areas, where many worked cultivating sugar. To determine who was Haitian, soldiers with machetes asked dark-skinned people to say the word "perejil", which is Spanish for parsley. For Creole-speaking Haitians, the "r" sound was difficult to pronounce, and a slip of the tongue became a death sentence. Estimates of the massacre range from 10,000 to 25,000 people killed over the course of a few weeks. And the bitter irony was that Trujillo's grandmother was Haitian.

Today the border continues to inspire fear. Dominican-born children of Haitian descent number around 210,000, in a nation of 10 million. Haitians have long been migrant workers, with many finding seasonal employment in sugar cane fields or other low-wage work, which has become especially crucial in the aftermath of the earthquake. And, like immigrants elsewhere, they are often blamed for taking jobs. At the same time, racialised fears of "Haitianisation" are still regularly voiced by politicians and sections of the media, though many Dominicans have expressed shock and anger over the court's decision. But violence is still directed at Haitians; crimes against them often go unreported; and many continue to live in dire poverty.

Deportations of workers who have no chance to appeal are common – the Dominican military reported it sent away some 47,700 Haitians in the past year, up from 21,000 the year before. And now tens of thousands of people who consider themselves Dominicans face a one-way trip to a country where they cannot speak the language, may not have any family, and face extreme economic hardship. The Haitian government said it "strongly disagrees" with the decision and has recalled its ambassador to the Dominican Republic for consultations on the implications of the ruling.

Anti-Haitianism in the Dominican Republic reaches back decades, if not centuries; unacknowledged and institutionalised, it has been manipulated and put to political use. Rather than being united by their shared histories, the two sides of Hispaniola remain riven by an unresolved past. It is not yet clear how this ruling will be turned into policy, but in facing such an uncertain future, these Dominicans also carry with them a heavy burden of the past.