LIMA (Reuters) - At least 6,000 Venezuelans lined up at Peru’s northern border on Tuesday in hopes of entering the country before a deadline for acquiring residency, and another 4,000 were due to arrive in the next two days, Peru’s ombudsman’s office said.

Slideshow ( 7 images )

Peru was one of the first countries to offer temporary residency cards for Venezuelans who have been fleeing their crisis-stricken homeland and crossing Colombia and Ecuador to reach Peru.

As the number of Venezuelans in Peru has surged to nearly half a million, the government moved the deadline from the end of the year to the end of October. They must enter the country by Wednesday to be eligible for the cards which allow them to live, work and study in the country legally.

Peru also started requiring passports for entry.

As the deadline has neared, a growing number of Venezuelans have crowded at Peru’s border with Ecuador, said Abel Chiroque, the head of the ombudsman’s office in the border town of Tumbes.

“Demand for services is overwhelming ... the capacity to respond has collapsed,” Chiroque said by phone, describing migrants who have been in line for nearly 24 hours. “The situation is worrisome.”

Chiroque said he asked the government to distribute tickets to Venezuelans in line when the deadline closes, so they can be eligible for the residency cards later.

Peru’s immigration agency did not immediately respond to requests for comment.

As oil-rich Venezuela’s economy has sunk into crisis under President Nicolas Maduro, as many as 1.9 million Venezuelans have emigrated since 2015, according to the United Nations. Some 90 percent of recent departures, the U.N. says, remain in South America.

The exodus has stressed social services and sparked concerns about crime and jobs in host countries, and many migrants are facing restrictive immigration laws and discrimination.

Peruvian President Martin Vizcarra said Monday that Peru could not give residency to Venezuelans indefinitely.