Updated

MADRID -- A powerful explosion at a Spanish military academy killed five soldiers and wounded three others on Thursday when a bomb disposal drill went awry, the Defense Ministry said.

Soldiers getting ready to deploy as peacekeepers with the U.N. mission in south Lebanon were carrying out an exercise involving a controlled detonation of anti-tank mines when the ordnance exploded before the soldiers could move a safe distance away, an ministry official.

"They were preparing to deactivate explosives in Lebanon. They were preparing to save lives in Lebanon when they lost their own," Defense Minister Carme Chacon said.

The blast occurred at an army academy in Hoyo de Manzares, about 20 miles northwest of Madrid.

Chacon described the explosion as very powerful and said the victims included some of Spain's top experts in bomb disposal and troops who had just returned from service in Afghanistan, where Spain also has forces deployed.

Three of the dead were from the Army and two were Marines.

Spain has about 1,000 troops stationed in south Lebanon as part of the United Nations peacekeeping mission launched in 2006 after a war between Israel and Hezbollah.

In June 2010 one Spanish officer died and six others were injured following an accidental explosion at a bomb disposal unit in a Civil Guard training barracks outside Madrid.