More than 250 people have been killed after a military plane carrying soldiers and their families has crashed in farmland in the north of Algeria, in what appears to be the worst plane crash in the North African nation's history.

Some 257 people were killed after the plane crashed near to an airbase in the town of Boufarik, south of the capital, Algiers.

Those killed included 247 passengers, made up of Algerian soldiers and their relatives, alongside 10 crew member, Algeria's defence ministry said.

It is the deadliest air crash in the world since 2014 when 298 people were killed on Malaysian Airlines flight MH17 after it was shot down over eastern Ukraine.

Malaysia airliner 'shot down' over Ukraine

The country's president, Abdelaziz Bouteflika, declared three days of national mourning and prayers for the dead on Friday.

Algerian emergency services converged on the area near the Boufarik military base after the crash, which took place at 7.50am local time.

Footage from the scene showed thick black smoke coming off the field, as well as ambulances and Red Crescent vehicles arriving at the site.

Witnesses say they saw a wing catch fire shortly after the plane 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."

Algerian TV Dzair said five people were in a critical state but it is unclear whether they were inside the plane when it crashed.

The Algerian defence ministry said that the cause of the crash was unclear and an investigation has been opened.

It said that the victims' bodies were transported to the Algerian army's central hospital in the town of Ain Naadja for identification.

The flight had just taken off from Boufarik, about 30 kilometres (20 miles) south west of the capital Algiers, for a military base in Bechar in south-west Algeria, according to Farouk Achour, chief spokesman for the civil protection services.

It was scheduled to make a layover in Tindouf in southern Algeria, home to many refugees from the neighbouring Western Sahara, a disputed territory annexed by Morocco.

The Soviet-designed Il-76 military transport plane crashed in an agricultural zone with no residents, Mr Achour said.

The Il-76 model has been in production since the 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.

Dutch investigators to give results of MH17 criminal probe

Among the fatalities are passengers from Western Sahara, a disputed territory annexed by Morocco after Spain withdrew in 1975.

The Polisario Front, which is seeking independence for the territory and is backed by Algeria, says 30 Western Saharans, including women and children, died.

A senior member of Algeria's ruling FLN party said those killed included 26 Polisario members.

Eyewitness Abd El Karim told the private Ennahar TV station: "After taking off, with the plane at a height of 150 meters I saw the fire on its wing. The pilot avoided crashing on the road when he changed the flight path to the field."

Another witness said: “We saw bodies burned. It is a real disaster”.

Algeria is the largest country in Africa and plane flights are often the best way to traverse the nation.

However there have been a number of serious crashes which have blighted the country in recent years.

It is the next in line following the crash of an Algerian military plane in February 2014, when a US-built C-130 Hercules turboprop crashed into a mountain, killing 77 people and leaving just one survivor.

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's database.

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

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 US and other western nations.

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

Employer pays tribute to Scottish man in Malaysian Airline crash

It is now the deadliest in the world since July 2014, after the Malaysian Airlines flight MH17 was shot down over eastern Ukraine, killing all 298 people on board.

Pro-Russian rebels are widely accused of shooting the plane down using a surface-to-air missile, though they deny responsibility

It is also the second-deadliest plane crash since 2003 when an Iranian military transport aircraft carrying 276 people crashed in the south of the country, killing all on board.