Italian, Spanish, Polish and German citizens were among those killed, as well as a Tunisian and a police officer, the prime minister said.
Security forces killed two gunmen and were searching for accomplices, he added.
At the time of the attack deputies in the neighboring parliamentary building were discussing anti-terrorism legislation. Parliament was evacuated following the attack.
At least 22 tourists and two Tunisians were injured in the attack, Habib Essid said.
“It is a critical moment in our history, and a defining moment for our future,” he said.
“We have not established the identity of the two terrorists,” the prime minister said.
He added: “Reports are not final, these two terrorists could have been assisted by two or three other operatives.”
Security operations were “still underway”, with forces “continuing to comb the area to find out the remaining operatives, if any”.
The remaining hostages held at the museum had been freed, Reuters news agency reported, citing an unnamed government official.
Local media reports said British, Italian, French and Spanish nationals were among those taken hostage during the attack.
Local television footage showed tourists fleeing to safety, escorted by security forces.
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”.
The attack is a huge blow for Tunisia’s tourism industry and its government, which only emerged at the end of a long political transition several months ago.
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.
Concerns about security in Tunisia have increased in recent months as neighboring 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.
o7lzOTJ5uoAImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…