Deputy Prime Minister Soraya Saenz de Santamaria said 35-year-old Sgt. David Fernandez died Friday while defusing an improvised explosive device.
The Defense Ministry said the device had been found on a road between the northwestern towns of Qala-i-Naw and Darra-i-Bun during a routine mission.
Spain has about 1,500 troops in Afghanistan's northwestern Badghis province. It has lost some 100 soldiers since deploying in 2002.