(Refiles to fix spelling of byline, text unchanged)

* Niger instructed UNHCR not to build refugee camps

* Local officials say Niger concerned by security risk

* Lack of camps hampers relief efforts

* Boko Haram punishing villages after Nigeria arms militia

By Misha Hussain

DAKAR, Feb 25 (Thomson Reuters Foundation) - Gremah Umara was hoping for a refuge when he, his wife and their two-year-old daughter fled an Islamist militant attack on their village in northern Nigeria and headed over the border into Niger.

They found a respite from the violence, but little else - just scores of their compatriots living rough under trees and sheltering in cardboard boxes, lined up along dusty roads in the impoverished country's Diffa region.

Tens of thousands of people have gone to Niger to escape a wave of attacks and bombings by Islamist sect Boko Haram, which is fighting to carve out an Islamic country from Nigeria's northern states, say aid workers.

The government in Niamey has granted them refugee status, but U.N. workers say it has also banned the construction of formal camps, fearing any structures could encourage an even bigger influx - or even bring fighters over the border.

"We're living on the charity and hospitality of locals and aid organisations," said 28-year-old Umara. "It's difficult to feed my family. We eat once a day, twice at best."

A spokesman for Niger's Interior Ministry was not immediately available for comment. But Hassane Ardo Ido, general-secretary of Diffa province, said authorities feared militants might infiltrate the camps and use them as bases: "We are trying to handle the situation and stop any act that could hurt our security," he said.

His caution echoes worries across the region that Boko Haram's campaign could spread instability. The affected areas of northern Nigeria also border Chad and Cameroon. Washington believes Boko Haram has had links to North Africa's Al-Qaeda in the Islamic Maghreb (AQIM) and other al Qaeda-linked groups in the Sahel region.

But the lack of formal camps has also deprived the refugees, of centralised, organised services, from food and shelter to healthcare, say aid workers.

PRESSURE ON RESOURCES

Gremah said the Islamist gunmen arrived in his Nigerian village after the evening prayer, called out the names of two militiamen and shot them dead when they came forward. "Then the assailants kept shooting, killing people, burning down shops," he said.

When his family arrived in Guessere, a small village in Diffa just 2 km (1.3 miles) from the frontier, they found Nigerians living outside in the harsh desert winter - scorching hot by day, freezing by night.

Thousands of other refugees are scattered in villages along the border, straining food resources for a local population already hit by cyclical droughts, disease and high birth rates.

The U.N. refugee agency's (UNHCR) country representative in Niger, Karl Steinacker, said Niamey was particularly worried because most of refugees came from the Kanuri ethnic group, a stronghold of Boko Haram.

"The authorities are worried the Nigerian insurgency might spill over into Niger," he said.

"From a security point of view, camps are often difficult to handle ... I think it was for that reason that the Niger government didn't want camps for the Nigerians. They must believe that they can better control a dispersed refugee population than one concentrated in a camp," he added.

Niger is one of the poorest countries in the world and the Diffa region suffered a poor harvest last year. Around 4.2 million people - roughly a quarter of Niger's population - are at risk of hunger according to the United Nations.

Outside the harvest, there is little work. Locals have run low on resources to share with the steady stream of refugees.

In Guessere, 1,650 people arrived in a village that has less than 1,000 inhabitants.

UNHCR is building homes for the refugees and distributing food but is struggling to cope with the arrivals.

"The influx is like a bush fire," said Steinacker. "You think you've extinguished the flames in one place only to learn the fire is back in another corner of this vast and dry area."

Steinacker said the surge in refugees followed revenge attacks on Nigerian villages after the Abuja government launched a military crackdown on Boko Haram in December and armed local militia. At least 200 people were killed last week alone.

"The problem is Boko Haram doesn't just kill the militia but they punish the whole village," said Steinacker. "The militia is no match for Boko Haram so the whole village moves." (Editing by Daniel Flynn and Andrew Heavens)

Our Standards: The Thomson Reuters Trust Principles.