Residents of the world’s biggest refugee camp have called on the Kenyan government to reverse plans to close the settlement, saying proposals for forced returns of Somalis to their war-torn country would amount to a mass death sentence.

Abdullahi Aden Hassan, a father of nine who was one of the first to arrive in the Dadaab camp fleeing the civil war in Somalia in 1992, told the Guardian refugees had received the news, confirmed this week, with shock.

“This is unbelievable,” said Aden, who serves as the spokesman of the refugees in the camp. “Everyone is just stunned and really sad. There is still war going on in so many parts of Somalia. It is simply too dangerous to return at this time.”

The Kenyan government announced it would send all 330,000 refugees in Dadaab, a sprawling desert tent city which is the third biggest settlement in Kenya, back to Somalia, saying the camp harboured terrorists.

“For reasons of pressing national security that speak to the safety of Kenyans in a context of terrorist and criminal activities, the government of the Republic of Kenya has commenced the exercise of closing Dadaab refugee complex,” the interior minister, Joseph Nkaissery, said at a news conference in Nairobi on Wednesday.

Speaking on the sidelines of the World Economic Forum meeting in Rwanda on Thursday, the foreign affairs minister, Amina Mohamed, said Kenya would not back down on its decision as it had in the past.

The diplomat said: “[It is] an issue of balancing national security interests and international obligations; I’ve been doing what I am doing for over 30 years. I’ve never come across a country that puts its international obligations above its national interests.”

Rights campaigners have strongly criticised the Kenyan government’s decision, saying it flies in the face of international law and would seriously violate the rights of the refugees.

“By unilaterally closing the refugee camps, Kenya will be in grave breach of the principle of non-refoulement, which protects asylum seekers and refugees from being returned to places where their lives and freedoms could be threatened,” the Kenya National Commission on Human Rights said in a statement.

More than a dozen aid groups who work in the camps have called on the Kenyan government to reconsider the move, as have rights campaigners.

“Refugees in the country have fled the very violence the authorities say they are trying to combat,” said Kate Allen, director of Amnesty International UK. “If the closure of the camps goes ahead, it will have devastating consequences for the hundreds of thousands of refugees.”

Kenya has been one of the world’s biggest host countries for refugees for decades, as tens of thousands have fled strife and famine in a rotating set of countries in the region, including Ethiopia, Somalia, Uganda, Burundi and the Democratic Republic of Congo.

However, a string of attacks by the Somalia-based al-Shabaab group, which was behind the massacre of nearly 150 students at a university last summer and the Westgate mall siege in Nairobi in 2013, has led to growing intolerance against refugees and general harassment and profiling of ethnic Somalis in the country.

An overview of part of the eastern sector of the sprawling refugee camp, north of Nairobi. Photograph: Tony Karumba/AFP/Getty Images

An effort to arrest all refugees living outside the camps in Kenya’s urban centres three years ago was widely condemned after police turned it into an exercise in large-scale extortion and harassment of those who were detained.

However, rights groups have urged Kenyan authorities to go after the individuals involved in militant activities without engaging in blanket condemnation of refugees.

Aden said the refugees in the camp were especially shocked because the announcement followed recent improvements in security in Dadaab, with no attack reported there in months.

Aden, who said he fled from Lower Juba, a village now controlled by al-Shabaab, added: “This has been the home of three generations of my family for 25 years. All my children were born here and my daughters got married and bore my grandchildren here. I can’t see how I can build a new life in Somalia where the fighting is still going on.”

Fadumo Ali Noor, who fled from Baidoa in south-western Somalia in the early 1990s, said: “I never slept last night after listening to the news on the radio. We appreciate all the work Kenya has done hosting us, but we urge them to reconsider because this is the only home we know.”

Somali children smile as they sing during class at the camp. Photograph: Jerome Delay/AP

A decision by authorities to shut down the department of refugee affairs, which registers new arrivals and is the principal government agency operating in camps, has added to the enveloping sense of anxiety among refugees.

Mohamed Barud, a correspondent for the Somali-language Star FM who is based in Dadaab, said refugees seeking medical attention outside the camps or who hoped to travel to other parts of Kenya for their studies were now trapped because only government officials could offer travel permits.

Kenyan authorities had earlier threatened to also close the Kakuma camp, which is home to 180,000 mainly South Sudanese refugees. On Wednesday, they said they had reversed the decision, but residents of Kakuma remain concerned.

Simon Puot Poth arrived in Kakuma as an 11-year-old amid the wave of the thousands of “lost boys” of South Sudan who trekked hundreds of miles to find refuge from civil war. He said Kenya was the only home most in the camp knew.

“The refugee word is just a tag. We are human beings and should be regarded as such,” said Puot. “The people of Kenya have been very good hosts, but if there is now a security issue, the government should identify the few bad elements instead of punishing everyone.”

Puot volunteers as the headteacher at Hope primary school, a makeshift learning centre that accommodates 7,637 students with a teaching staff of just 37. He said refugees could only return home when lasting peace had been found.

People from South Sudan queue for a wet-food ration in Kakuma refugee camp. Photograph: Thomas Mukoya/Reuters

“I can’t go back to South Sudan with the situation as it is,” he said. “In fact, I now plan to apply to be a naturalised Kenyan. I’ve been in Kenya for 13 years and speak better Kiswahili than most Kenyans.”

Visiting Kakuma on Thursday, David Miliband, the former UK foreign minister and head of the International Rescue Committee (IRC), said refugees should not be forced to return.

“Our own view is very strongly that the historic long-term international commitment, that refugees should not be forcibly returned to their country of origin, should be maintained,” Miliband said. “Our position is not to be for or against camps, we are for dignity and human support for refugees.”

Miliband said there must be “informed decision-making that respects the Kenyan perspective and also respects the rights of refugees who are, after all, the innocent victims of other people’s wars”.

The Somali authorities said they had a plan for the safe and dignified resettlement of refugees in their home country.

“Abandoning this will be a legal and moral failing on the part of Kenya,” they said. “Expelling vulnerable Somali refugees at a time Somalia is making internationally recognised progress towards stability and institution building will only increase the risk of insecurity in the region.”

Kenya has appointed a taskforce, due to report later this month, that will produce recommendations and a timeline for closing Dadaab.

Twenty-five years after it opened, Kenya has announced its third biggest ‘city’, the Dadaab refugee complex, is to be shut down. But for many residents, this sprawling slum in an inhospitable desert is the only home they know