By Tarek Amara

TUNIS (Reuters) - Gunmen attacked Tunisia's national museum near its parliament on Wednesday, killing at least seven tourists and taking others hostage inside the building, the government said.

Foreign tourists ran for shelter, covered by security forces aiming rifles into the air, live television footage showed.

Security forces were surrounding at least two militants in the Bardo museum, a venue in central Tunis on the parliament grounds that is a popular site for visiting foreigners, the interior ministry spokesman said.

The attack on such a high profile target is a huge blow for the small North African country that relies heavily on European tourism and has so far avoided major militant violence since its 2011 uprising to oust autocrat Zine El-Abidine Ben Ali.

Tunisian authorities did not release any details on the nationalities of the hostages. If any foreigners were killed, Wednesday's assault would the worst assault involving them since an al Qaeda suicide bombing on a synagogue killed 21 people on the tourist island of Djerba in 2002.

The spokesman for the interior ministry said seven tourists and one Tunisian had been killed.

An official at the Italian foreign ministry in Rome said two Italians had been wounded in the attack, but it was not clear whether they were among the hostages.

About another 100 Italians were in the area and had been taken to safety by Tunisian police, authorities added.

Tunisia uprising inspired "Arab Spring" revolts in neighbouring Libya, Egypt, Syria and Yemen. But its adoption of a new constitution and staging of largely peaceful elections has won widespread praise and stood in stark contrast to the chaos that has plagued those countries.

Several militant groups have emerged in Tunisia since the uprising, including Ansar al Sharia which is listed as a terrorist organisation by the United States.

Authorities estimate 3,000 Tunisians have also joined militant groups in Iraq and Syria and some have returned home, increasing government fears of an attack on Tunisian soil.

Islamic State affiliates in Libya are gaining a foothold as two rival governments there battle for control. A senior Tunisian militant was killed while fighting for Islamic State in the Libyan city of Sirte over the past week, authorities said.