Britain's military apologized Tuesday for using emails to tell several dozen long-serving soldiers, including one fighting in Afghanistan, that they were being laid off.

The army said an "administrative error" meant the servicemen were not told in person that their contracts would be ended because of cutbacks.

As government opponents leapt on the episode as an example of the government's heartless attitude to spending cuts, ministers rushed to condemn the blunder.

Prime Minister David Cameron felt that "the way this has been handled is completely unacceptable," said a Downing Street spokesman, speaking on condition of anonymity in line with government rules.

Defense Secretary Liam Fox said has was "furious" at the error, and was due to explain the incident to lawmakers in the House of Commons later Tuesday.

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

News of the email blunder comes as the armed forces face deep cuts imposed by the government in a bid to cut the country's large deficit.

The soldiers were 38 warrant officers, each with more than 20 years' service, who are on rolling short-term contracts. A Ministry of Defense spokesman confirmed one of the officers was serving in Afghanistan when the emails were sent out in mid-January.

The 38 soldiers each received an impersonal message saying their contracts would be terminated in 12 months and advising them to "start planning your resettlement."

The army apologized for the distress caused and said the soldiers had since been spoken to by their commanding officers.

The move was criticized in a country proud of its military, especially troops serving overseas.

Soldiers on these short-term contracts, of which Britain has roughly 600, expect to be contacted annually in January to discuss the renewal of their jobs.

"Normally, such emails are sent to the command instead of directly to the soldiers," a Ministry of Defense spokesman said , on condition of anonymity in line with government policy. "Regrettably the emails were sent directly to 38 soldiers."

Jim Murphy, defense spokesman for the opposition Labour Party, said they had been treated in a "callous, cold-hearted, soulless" way.

"Sacking anybody by email is wrong, but sacking our armed forces in this way is absolutely unforgivable," he said. "We can't halt every redundancy in the armed forces, but this is no way to treat men and women who have served their country fearlessly for so many years."

The British army is shrinking by some 17,000 troops and the military is scrapping a fleet of fighter planes and an aircraft carrier as part of the government's deficit-slashing agenda.

Murphy cited the email sacking as an example of how the current government is running the Ministry of Defense in "shambolic way" led by cuts, rather than by Britain's military and foreign policy needs.