ALGIERS, Algeria — An Algerian military plane carrying soldiers, their families and some refugees crashed soon after takeoff Wednesday into a field in northern Algeria, killing 257 people in what appeared to be the North African nation's worst-ever aviation disaster.

Algeria's Defense Ministry said those killed included 247 passengers and 10 crew. An Algerian-backed group seeking independence for Western Sahara said 30 of its people, including women and children, were among the dead.

The cause of the crash was unclear and an investigation has been opened.

Algerian authorities did not mention any survivors but one witness reported seeing some people jump out of the aircraft before it crashed at 7:50 a.m. Wednesday. Algerian TV Dzair said five people were in a critical state but it's unclear whether they were inside the plane when it crashed.

The flight had just taken off from the Boufarik military base, 30 kilometers (20 miles) southwest of the capital Algiers, for the southwestern military base in Bechar, according to Farouk Achour, spokesman for Algeria's civil protection services. The flight also included a layover in the southern city of Tindouf, he said.

The Soviet-designed Il-76 military transport plane crashed in a farm field with no people nearby, Achour said.

Footage from the scene showed thick black smoke coming off the field, ambulances and Red Crescent vehicles arriving at the crash site and body bags lined up in the field.

Several witnesses told Algerian TV network Ennahar they saw flames coming out of one of the planes' engines just before it took off. One farmer said some passengers jumped out of the aircraft before the accident.

"The plane started to rise before falling," an unidentified man lying on what seemed to be a hospital bed told Ennahar TV. "The plane crashed on its wing first and caught fire."

The victims' bodies have been transported to the Algerian army's central hospital for identification.

Algeria is vast and plane flights are often the best way to traverse Africa's largest nation.

Tindouf is home to many refugees from the neighboring Western Sahara, a disputed territory annexed by Morocco.

The Algeria-backed Polisario Front, which seeks independence for Western Sahara from Morocco, told The Associated Press that 30 refugees who had been treated in Algerian hospitals were among those killed in Wednesday's crash.

Algeria President Abdelaziz Bouteflika declared three days of national mourning and prayers for the dead on Friday.

The Il-76 model has been in production since 1970s and has an overall good safety record. It is widely used for both commercial freight and military transport. The Algerian military operates several of the planes.

It was the first crash of an Algerian military plane since February 2014, when a U.S.-built C-130 Hercules turboprop slammed into a mountain in Algeria, killing at least 76 people and leaving just one survivor.

The heavy loss of life of soldiers was certain to shake Algeria to the core. The National Liberation Army — which grew out of the fighting force which freed Algeria from French colonial rule — is revered by Algerians.

Today, the army is credited with saving the nation from a deadly insurgency by Islamist extremists in the 1990s and early 2000s. The battle continues with sporadic attacks around Algeria and networks dismantled by soldiers.

The army's experience fighting terrorism has made it a valued ally of the U.S. and other western nations.

The U.S. Embassy in Algiers expressed its "deepest condolences" to "our partners and colleagues in the Algerian military," and their families.

The previous deadliest crash on Algerian soil occurred in 2003, when 102 people were killed after a civilian airliner crashed at the end of the runway in Tamanrasset. There was a single survivor in that crash.

Also in 2003, 10 people died when an Algerian Air Force C-130 crashed after an engine caught fire shortly after it took off from the air base near Boufarik, according to the Aviation Safety Network.

___

Samuel Petrequin and Elaine Ganley in Paris contributed to this report.