Two helicopters carrying NATO (search)-led forces to prepare for next month's elections crashed Tuesday in the desert in western Afghanistan, killing at least 17 Spanish troops, officials said.

Afghan army commander Abdul Wahab Walizada (search), whose troops are providing security in the area near Herat, said the aircraft came too close to each other while flying and their rotor blades collided.

But Spain's (search) defense minister dismissed that suggestion and said hostile fire could not be ruled out after the pilot of one of the helicopters reported seeing a column of black smoke in a nearby valley.

"It could have been an accident or it could have been an attack from the exterior," minister Jose Bono said in Madrid.

Maj. Andrew Elmes, a spokesman for NATO's International Security Assistance Force in Kabul (search), said it was too soon to know the cause, but it was believed to have been an accident and not due to rebel activity. He said earlier that mechanical failure might have been to blame. Herat province is largely free of violence by Taliban-led rebels.

"We do not think the helicopter crashed because of enemy activity. We think it was an accident," Elmes said. "The second helicopter landed heavily. There are survivors from that helicopter."

He said rescuers had reached the site.

The victims were the first Spanish troops to be killed in Afghanistan, officials said. Spain has about 800 troops in Afghanistan assisting the NATO-led security force.

The helicopter that crashed belonged to the international security force. The other chopper made an emergency landing in the area, injuring five soldiers, the Spanish defense minister said.

The crash came less than two months after suspected insurgents shot down a U.S. military Chinook helicopter in eastern Kunar province — a hotbed for Taliban and Al Qaeda (search) insurgents — near the border with Pakistan. All 16 U.S. servicemen on board were killed.

Elmes said both choppers in Tuesday's incident were on a training mission to support crucial Sept. 18 legislative elections — the next major step toward democracy for Afghanistan after more than two decades of war and civil strife.

Spanish Prime Minister Jose Luis Rodriguez Zapatero (search) broke off his vacation in the Canary Islands to return to Madrid and meet with defense ministry officials, his office said.

The crash was the second major deadly incident involving Spanish troops deployed in Afghanistan. In May 2003, 62 Spanish peacekeepers returning home from Afghanistan died when their Russian-built YAK-42 plane crashed near Trabzon in northwest Turkey (search). Thirteen Ukrainian and Belarusian crew members of the aircraft also died.

In April, 15 U.S. service members and three American civilians were killed when their Chinook went down in a sandstorm while returning to the main U.S. base at Bagram.

NATO's force in Afghanistan includes about 10,000 troops from 36 nations. It maintains security in the capital, Kabul, and the country's north and west. It plans to increase its size by an unspecified amount and take over from the U.S.-led coalition in the violence-wracked south early next year, before gradually moving into the east.