The F-16 jet "lost power" as it took off from the base near the southeastern city of Albacete and crashed into an area where other planes were parked, striking several of them, the defence ministry said in a statement.
Television footage showed flames billowing from the crash site, which was shrouded in black smoke.
Among the injured at the Nato base were nine Italians, seven of them only lightly, Italy's defence ministry said.
The plane was taking part in Nato's Tactical Leadership Programme, which is designed to improve multinational cooperation in air operations.
Nato Secretary General Jens Stoltenberg said he was "deeply saddened" by the disaster.
"This is a tragedy which affects the whole NATO family. I express my heartfelt condolences to the loved ones and the nations of those who lost their lives, and I wish a speedy recovery to the injured," he said in a statement.
Spanish Prime minister Mariano Rajoy said he was "moved" by the accident in a Twitter message and expressed his condolences for the deceased.
Defence Minister Pedro Morenes and the chief of staff of Spain's airforce, Francisco Javier Garcia Arnaiz were on their way to the airbase, which is
located about 250 kilometres (150 miles) southeast of Madrid.