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, damaging at least five other aircraft, the defence ministry said in a statement.
Television footage showed flames and thick black smoke billowing from the crash site, as sirens wailed in the background.
At least 19 other people were injured in the accident, including five who were moved to a burn unit of Madrid's La Paz hospital, the defence ministry said. The rest are being treated at a hospital in Albacete.
Spain's El País newspaper put the number of injured at 21 on Tuesday morning, with 11 of those Italians and ten French.
The French presidency confirmed the eight deaths and said another six French mechanics suffered serious burn injuries.
French President Francois Hollande "expressed his deep respect for the commitment" of the airmen who were preparing for operational missions within the air force to fight "against terrorist groups" in Iraq and the Sahel region.
France's defence ministry said one of those injured was in a "very serious condition" while another two had been placed in a medically-induced coma.
Italy's defence ministry said nine Italian nationals were injured, only two of them seriously.
Spain's Defence Minister Pedro Morenes and the chief of staff of Spain's airforce, Francisco Javier Garcia Arnaiz, arrived at the airbase late on Monday, located about 250 kilometres (150 miles) southeast of Madrid.
French Defence Minister Jean-Yves Le Drian was expected to visit the site of the accident on Tuesday.
Tragedy for NATO family
The Spanish ministry said the jet that crashed was taking part in a NATO training exercise called the Tactical Leadership Programme (TLP) which seeks to improve multi-national 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.
The Tactical Leadership Programme was formed in 1978 by NATO's Central Region air forces to advance their tactical capabilities and produce tactics, techniques and procedures that improve multi-national air operations, according to a US air force website.
The ten NATO countries that take part in the programme are Belgium, Britain, Denmark, France, Germany, Greece, Italy, the Netherlands, Spain and the United States.
According to the French defence ministry's website, it is "the most renowned and most demanding" programme for fighter pilots.
Rajoy expressed his condolences in a Twitter message, saying he was "moved" by the accident.
The base has housed the training centre for NATO pilots since 2010, according to its website.
"It's a school for pilots, which is home to 10 nationalities," the Spanish defence ministry said.