By Tarek Amara and Mohamed Argoubi
TUNIS (Reuters) - Gunmen wearing military uniforms stormed Tunisia's national museum on Wednesday, killing 17 foreign tourists and two Tunisians in one of the worst militant attacks in a country that had largely escaped the region's "Arab Spring" turmoil.
Five Japanese as well as visitors from Italy, Germany, Poland and Spain were among the dead in the noon assault on Bardo museum inside the heavily guarded parliament compound in central Tunis, Prime Minister Habib Essid said.
"They just started opening fire on the tourists as they were getting out of the buses ... I couldn't see anything except blood and the dead," the driver of a tourist coach told journalists at the scene.
Scores of visitors fled into the museum and the militants - who authorities did not immediately identify - took hostages inside, officials said. Security forces entered around two hours later, killed two militants and freed the captives, a government spokesman said. A police officer died in the operation.
The attack on such a high-profile target is a blow for the small North African country that relies heavily on European tourism and has mostly avoided major militant violence since its 2011 uprising to oust autocrat Zine El-Abidine Ben Ali.
Several Islamist militant groups have emerged in Tunisia since the uprising, and authorities estimate about 3,000 Tunisians have also joined fighters in Iraq and Syria -- raising fears they could return and mount attacks at home.
"All Tunisians should be united after this attack which was aimed at destroying the Tunisian economy," Prime Minister Essid declared in a national address.
The local stock exchange dropped nearly 2.5 percent and two German tour operators said they were cancelling trips from Tunisia's beach resorts to Tunis for a few days.
Accor (PARIS:ACCP), Europe's largest hotel group, said it had tightened security at its two hotels in Tunisia.
U.S. Secretary of State John Kerry said Washington condemned the attack and continued "to support the Tunisian government's efforts to advance a secure, prosperous, and democratic Tunisia."
Television footage showed dozens of people, including elderly foreigners and one man carrying a child, running for shelter in the museum compound, covered by security forces aiming rifles into the air.
State television said 17 tourists were killed. Among the dead were three Italians, two Colombians and two Spaniards, their country's governments said. Tunisian officials said 24 foreign tourists were wounded.
The museum is known for its collection of ancient Tunisian artifacts and mosaics and other treasures from classical Rome and Greece. There were no immediate reports that the attackers had copied Islamic State militants in Iraq by targeting exhibits seen by hardliners as idolatrous.
The museum's white-walled halls set in the parliament compound are one of the most popular tourist attractions in the Tunisian capital.
Shocked but defiant, hundreds of Tunisians later gathered in the streets of downtown Tunis waving the country's red and white crescent flag, and chanting against terrorism.
"I pass this message to Tunisians, that democracy will win and it will survive," President Beji Caid Essebsi said in a television statement. "We will find more ways and equipment for the army to wipe out these barbarous groups for good."
A MODEL OF COMPROMISE
Tunisia's uprising inspired "Arab Spring" revolts in neighbouring Libya and in Egypt, Syria and Yemen. But its adoption of a new constitution and staging of largely peaceful elections had won widespread praise and stood in stark contrast to the chaos that has plagued those countries.
After a crisis between secular leaders and the Islamist party which won the country's first election, Tunisia has emerged as a model of compromise politics and transition to democracy for the region.
But security forces have clashed with some Islamist militants, including Ansar al-Sharia which is listed as a terrorist group by Washington, mostly in remote areas near the border with Algeria.
Affiliates of Islamic State militants fighting in Iraq and Syria have also been gaining ground in North Africa, especially in the chaotic environment of Tunisia's neighbour Libya, where two rival governments are battling for control.
A senior Tunisian militant was killed while fighting for Islamic State in the Libyan city of Sirte over the past week. Security sources said he had been operating training camps and logistics.
Wednesday's assault was the worst attack involving foreigners in Tunisia since an al Qaeda suicide bombing on a synagogue killed 21 people on the tourist island of Djerba in 2002.
A militant blew himself up at the Tunisian beach resort of Sousse in late 2013 but no one else was killed or wounded.