Thousands of Haitians have been lining up this summer at government offices in the Dominican Republic trying to take advantage of a rare chance to secure legal status in a country where they've long lived in the shadows.

For most, hope is quickly turning into disappointment.

Since a program to grant residency to Haitians who have been living in the Dominican Republic since 2011 opened June 2, only a tiny fraction of applicants have managed to show sufficient documentation from their homeland to secure the status, officials say. And a deadline to register or face deportation arrives early next year.

Migrant workers like Luccene Philome, part of a small group who spent a recent night camped out at the Ministry of the Interior to be at the front of the line the next day, say they are being told that their documents must include a Haitian identity card, passport or birth certificate.

"I lacked just about everything," Philome said as he emerged from the office. The 36-year-old, whose many years as a bricklayer have worn down his hands, even had a tough time getting his fingerprints taken by Dominican officials.

Migrants from Haiti have long had a tough time in the Dominican Republic, but in this case their anger is largely directed at Haiti's government, which has been slow to issue the needed documents amid its usual bureaucratic torpor and has been charging fees that are far higher than most people can afford. Haitians have staged several protests in recent weeks outside their government's embassy in Santo Domingo over the issue.

Haiti is charging the equivalent of about $60 for a new birth certificate, voter ID and a passport, a special rate for the migrant registration process since it normally costs $80 for a just a passport. Still, it's too expensive in a place where migrant workers barely earn $5 a day, said William Charpentier, director of the National Migration Roundtable, a non-governmental group.

"In our view, the Haitian authorities have been somewhat irresponsible," Charpentier said.

The Haitian government has been coming under increasing international pressure to address the issue and a solution may emerge before the deadline. But the Dominican residency process, known as "regularization," is clearly off to a slow start. Of the more than 50,000 migrants who have sought to register, less than 10,000 had any kind of formal documentation of their identity and only 120 met all the requirements, Interior Minister Ramon Fadul says.

No one knows exactly how many migrants live in the Dominican Republic, but the United Nations estimates there may be as many as 500,000. The two countries share the island of Hispaniola and a porous border that in some places is no more than a dry riverbed or a chalk-white dusty road.

Comparatively much wealthier than its neighbor, the Dominican Republic has long been a magnet for low-wage workers from Haiti but it has been seeking to limit unregulated, cross-border traffic in recent years.

As part of that effort, the Dominican government agreed to allow migrants who came before October 2011 to register to stay and work.

It's a separate issue from a controversy ignited last year when the country's Supreme Court ruled that people born in the Dominican Republic to non-citizens are not eligible for citizenship. Human rights groups say the retroactive decision effectively disenfranchises hundreds of thousands of people. The government has approved a program to resolve their status but it has not yet been implemented.

Migrants who may qualify for residency are scrambling to get documents from the Haitian Embassy or back in Haiti. And they are spending the night at Interior Ministry offices, sometimes entire families.

"A lot of people are coming here, everyone in my neighborhood," said Odige Liphete, a 26-year-old migrant in one line.

Without residency papers, migrants fear deportation when the deadline expires and a life in which they cannot work or enroll in school.

Philome says he will keep trying to secure his documents.

"I've got to take the time to do it, if I don't take the time I won't achieve anything," he said.