Tonny Onyulo

Special for USA TODAY

DADAAB REFUGEE CAMP, Kenya — Joy erupted in the world's largest refugee camp Thursday after Kenya’s High Court overturned the government’s decision to close the massive facility and force residents back to the homelands they had fled, principally war-torn Somalia next door.

Jubilant crowds poured onto the camp's streets singing, dancing, waving branches and carrying signs that proclaimed, "We are going nowhere." Many broke into tears upon hearing the news, which spread rapidly through the camp of 330,000 people, located in northeast Kenya near Somalia's border.

“Allah has answered our prayers and we’ll live here until we achieve our dreams," said Abdirahnan Abdala, 24. "Somalia is very insecure right now and we can’t go there.”

Aminah Bilan, 46, a mother of six who was waiting to be sent back to Somalia next week, called the court decision "a clear victory for all refugees like me who have nowhere to go. I am now relieved and feel safe."

“I was afraid that my children would be raped and others forced to join al-Shabab," she said of the Somali terrorist group. "I was facing death in Somalia.”

The ruling came a day after Somalia held its first democratic election in decades amid tight security because of the constant violence that plagues the east African nation.

Somalia elects first new president in decades

Kenya’s government said it will appeal the decision. "Kenya will always come first. The lives of Kenyans matter. ... It is for this reason that we shall be strongly appealing the decision,” said government spokesman Eric Kiraithe. He said the government decided to close the camp because it has become a “launch pad for various terrorist attacks by Al-Shabab.”

The government declared last May that it planned to shut the 25-year-old camp because it has become a “breeding ground for terrorism.” After an outcry by humanitarian groups, the government said in November that it would delay the closure for six months because of increased war in Somalia, where al-Shabab militants control much of the countryside. The government also said it lacked funds to help relocate all the displaced refugees.

Al-Shabab carried out several attacks in Kenya after the Kenyan government sent troops to Somalia in 2011 to fight the militants. An assault on the Westgate mall in Nairobi in 2013 killed 67 people, and a 2015 attack on Garissa University killed 148 students and teachers.

The High Court in Nairobi ruled in favor of opponents of the camp's closure,which included groups such as Amnesty International. It said the government had not proved the camp was a breeding ground for terrorists. Justice John Mativo said Interior Cabinet Secretary Joseph Nkaissery and Principal Secretary Karanja Kibicho acted beyond their powers in issuing the directive to close the camp.

The court also ruled the decision violated international treaties on refugees, and specifically targeting Somalis is an act of group persecution, illegal, discriminatory and, therefore, unconstitutional.

In addition, Mativo said the Kenyan government has not proved Somalia is safe for the refugees.

“We are now safe from government threats,” said Maalim Abdikadir, who owns a boutique shop in the market. “I have never known any other place apart from Kenya. I was born in Dadaab and am now here doing business. The Kenya government should now accept Somalis as part of Kenya.”