At least seven foreign tourists and a Tunisian have been killed after gunmen targeted a museum in the Tunisian capital, officials say.
Two attackers and a police officer were killed in the subsequent security operation, which was now over, officials added.
The attack happened at the Bardo Museum, which is next to the parliament building in central Tunis.
At the time of the attack deputies were discussing anti-terrorism legislation.
Parliament has now been evacuated.
British, Italian, French and Spanish nationals were among those taken hostage during the attack, local radio reported.
All the hostages held at the museum had been freed, Reuters news agency reported, citing an unnamed government official.
Live updates from the BBC
Earlier, interior ministry spokesman Mohamed Ali Aroui told journalists that the attack involved "two or more terrorists armed with Kalashnikovs".
French Prime Minister Manuel Valls said he condemned the "terrorist attack in the strongest terms... we are very alert about how the situation is evolving," he added.
Eyewitness Yasmine Ryan told the BBC there had been "a growing crowd" of at least 500 people outside the museum.
She said she saw "helicopters flying overhead" and "tanks rolling in".
The Bardo museum, renowned for its collection of antiquities, is a major attraction in Tunis.
Tourism is a key sector of Tunisia's economy, with large numbers of Europeans visiting the country's resorts.
In 2002, 19 people, including 11 German tourists, were killed in a bomb blast at a synagogue in the resort of Djerba. Al-Qaeda said it had carried out that attack.
Concerns about security in Tunisia have increased in recent months as neighbouring Libya has become increasingly unstable.
A large number of Tunisians have also left to fight in Syria and Iraq, triggering worries that returning militants could carry out attacks at home.