Defence Secretary Liam Fox has said he is "furious" over the sacking by email of 38 soldiers - including one serving on the front line in Afghanistan.

He demanded an explanation of how it happened, saying this was "no way" to treat armed forces personnel.

"I am furious that such a situation should occur," he said in a statement issued by the Ministry of Defence.

"This is no way to treat our armed forces personnel. I want to know how this was allowed to happen and what measures will be put in place to prevent this from happening again."

His anger was disclosed after The Sun revealed that the men, all warrant officers, were told they were losing their jobs because the Army has to make "significant" cutbacks. Due to an error, the soldiers were given the news that their contracts would be terminated in 12 months by email - said to have been sent by an army career manager - instead of in person.

Each is reported to have received an impersonal message advising them: "Start planning your resettlement."

The group, who all have more than 20 years' service, includes a Royal Tank Regiment veteran serving on the front line in Afghanistan.

The newspaper quoted another who has completed five tours of duty in war zones as saying: "It was out of the blue. We're disgusted."

An Army spokesman said: "We apologise for the distress that this will have caused. Commanding officers have now spoken to the soldiers concerned to ensure that they receive all necessary advice and support."

Shadow defence secretary Jim Murphy said the sacking was "callous, cold-hearted and soulless" and called on ministers to explain what had happened.