Kalashnikov-wielding gunmen stormed a popular museum near Tunisia's parliament Wednesday afternoon, killing at least 17 tourists and taking hostages.

Tunisian Prime Minister Habib Essid said German, Italian, Polish and Spanish tourists were among the dead.

Government spokesman Mohamed Ali Aroui said that the attack had been carried out by two men armed with Kalashnikov rifles.

"Two militants opened fire on the tourists as they were getting off the buses before fleeing into the museum," a museum employee told Reuters at the scene.

Security forces surrounded the compound where the gunmen had taken hostages inside the museum. Less than three hours later the siege was over, after security forces stormed the museum in a shoot out that left the two gunmen and a police officer dead.

The Bardo Museum adjoins the Tunisian national parliament

There's been no confirmation of the nationality of the dead. But the foreign ministries of Poland and Italy have both reported their citizens among the six reported wounded.

All of the hostages have been freed, the Tunisian government said.

Built inside the walls of a 19th century palace, the National Bardo Museum is the country's largest museum. It holds one of the world's largest collections of Roman mosaics and is a top tourist attraction.

It is unclear who the attackers were. Tunisia has struggled with violent religious extremists. But clashes in recent years have targerted security forces, not foreigners or tourist sites. Wednesday's attack is a setback for the country's effort to revive its once thriving tourism sector.

French Prime Minister Manuel Valls pledged France - Tunisia's former colonial ruler - would act in solidarity with the Tunisian government through the crisis.

"This attack cruelly illustrates the threat that we are all confronted with in Europe, in the Mediterranean, around the world. France, Tunisia and Europe will act together to fight terrorism," Valls said from Brussels.

President Beji Caid Essebsi is preparing to make a public statement to the nation, his spokesman Moez Sinaoui told AFP.

jar/bw (Reuters, AFP, AP, dpa)