At least 19 people, including 17 foreign tourists have been killed after gunmen targeted a museum in the Tunisian capital, the prime minister says.
Italian, Spanish and German citizens were among those killed, PM Habib Essid said.
Two attackers and a police officer were killed in the subsequent security operation, officials said.
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.
The parliament has now been evacuated.
British, Italian, French and Spanish nationals were among those taken hostage during the attack, local radio reported.
The remaining hostages held at the museum had been freed, Reuters news agency reported, citing an unnamed government official.
Local television footage showed tourists fleeing to safety, escorted by security forces.
Earlier, interior ministry spokesman Mohamed Ali Aroui told journalists that the attack involved "two or more terrorists armed with Kalashnikovs".
A museum employee told Reuters the two attackers "opened fire on the tourists as they were getting off the buses before fleeing into the museum".
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 that 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.