Kenyan officials have responded severely to a string of terrorist attacks, ordering tens of thousands of refugees to vacate urban areas and head for designated refugee camps that are already overcrowded.

The move has alarmed human rights organizations, but Kenyan officials insist that targeting migrants is an effective way to protect civilians – particularly from the terrorist activities of al-Shabab, an extremist Islamist group based in neighboring Somalia that often perpetrates attacks on Kenyan soil.

“This is potentially a very damaging response,” says Adotei Akwei, managing director of government relations for Amnesty International. 

“It’s a complex situation, and there are not really any easy choices. But it is unfortunate that the Kenyan authorities are going down this particular path. Hopefully, we can keep things from going off the tracks.”

A government statement says that Somali refugees have become an “unbearable and uncontrollable threat to national security” and will no longer be welcome in urban areas. Any legal documentation the migrants currently hold will no longer be valid outside of the refugee camps.

Hundreds of thousands of Somalis have poured into Kenya in recent years, hoping to escape famine and the violence and instability perpetrated by al-Shabab and allies in their homeland.

Eastleigh, a district in Kenya’s capital city of Nairobi, has become a popular haven for these migrants and has become known as "Little Somalia."

But militants are also crossing borders, and Eastleigh has been the site of a string of attacks. The last incident occurred on Sunday, when grenade explosions shattered the windows in a butcher’s shop and injured at least one customer. Similar attacks in recent months have killed dozens of civilians.

The government has ordered migrants of Somali origin to pack their bags and head to the Dadaab refugee camp, a dusty expanse of tents and aid stations in Kenya’s North Eastern province. Migrants from other countries, including Sudan, Ethiopia and Eritrea, have been told to head for another camp called Kakuma, a secluded area in the far northwestern reaches of the country.

Dadaab was originally built to house between 80,000 and 90,000 people, but aid and construction workers have been struggling to accommodate a population that has now swelled to an estimated 500,000.

Overcrowding, exacerbated by a recent flooding, has hindered sanitation efforts in the camp. Food and water distribution can’t keep up with a continuing influx of refugees. Cases of malnutrition, cholera and hepatitis are increasingly common. And Dadaab, like Eastleigh, has suffered an increase in terrorist attacks this year.

"We are absolutely overstretched," Elena Velilla, who heads the Doctors Without Borders mission in Kenya, told the BBC. "We have no capacity at all to distribute more aid.”

International organizations including the United Nations refugee agency are expressing dire concerns. Opposition is present in the Kenyan government as well; one legislator has compared Dadaab to a concentration camp.

But the official line from the administration is that urban areas must be protected from militant offensives at all costs.

“It is in this public domain that many people have been killed and several more injured with grenade attacks in our streets, churches, buses and in business places,” said last week’s government statement.

Tensions are only heightened by a general election scheduled for March of next year.

“The last election was extremely violent,” said Akwei, referring to the 2007-08 turmoil that stirred up tribal animosities, killing more than 1,000 people and casting a dark shadow over the re-election of President Mwai Kibaki.

“There’s a general consensus that whatever can be done to prevent that from happening again should be done. One would hope that this population of refugees doesn’t become a target for attacks or political [rhetoric].”

Kenya’s ultimate goal is to stem the flow of refugees altogether by promoting stability in neighboring Somalia, where a transitional government was established this year in an attempt to end two decades of failed statehood.

To that end, Nairobi initiated a military operation called Linda Nchi ("Protect the country") in October 2011, sending thousands of troops into Somalia to battle militants and allies of al-Shabab in a concerted effort with African Union troops from other countries.

The push was somewhat successful; in September, the militants gave up their last stronghold in the Somali port city of Kismayo. But al-Shabab, which has pledged allegiance to al-Qaeda, has been able to perpetrate attacks in Kenya and Somalia even without a home base.

Kenyan troops are still present in Somalia as the war-torn country struggles to cobble together an effective government, and al-Shabab is still active in both countries.

Meanwhile the expulsion of refugees from urban areas inside Kenya is a sure sign that this battle is becoming an increasingly domestic one.

“I think the underlying issue is that Kenya is not in a position to handle the refugee population. It’s something that has challenged successive administrations, and the additional twist -- that these refugees now being perceived as facilitating the activities of al-Shabab -- is generating a much harsher response,” says Akwei.

“What we’re trying to do now is either find a way to increase resources at Dadaab or have the Kenyan authorities reconsider their decision,” he added. “I’m not so optimistic about the latter.”