It wasn't immediately clear who the attackers were, or if they took hostages.
Security forces filled the area around the National Bardo Museum after the attack. Tunisia's parliament building, near the museum, was being evacuated, according to a tweet by parliament member Sayida Ounissi.
Private radio station Radio Mosaique said that three men dressed in military-style clothing may have taken hostages inside the museum.
Interior Ministry spokesman Mohamed Ali Aroui said on Wataniya television that eight were dead — seven foreign tourists and one Tunisian. He didn't provide nationalities for the foreign victims. Poland's Foreign Ministry announced that three Poles were among the wounded.
Tunisia recently completed a rocky road to democracy after overthrowing its authoritarian president in 2011. It has been more stable than other countries in the region, but it has struggled with violence by Islamic extremists in recent years, including some linked to the Islamic State group. It also has extremists linked to al-Qaida's North Africa arm who occasionally target Tunisian security forces.
A disproportionately large number of Tunisian recruits — some 3,000, according to government estimates — have joined Islamic State fighters in Syria and Iraq.
The violence that Tunisia has seen in recent years has been largely focused on security forces, not foreigners or tourist sites.
The attack is a blow to Tunisia's efforts to revive its tourism industry.
The National Bardo Museum, built within a 15th-century palace, is the largest museum in Tunisia with collections covering two floors, and it houses one of the world's largest collections of Roman mosaics.
The museum is near the North African country's parliament some 4 kilometers (2 ½ miles) from the city center. A new wing with contemporary architecture was built as part of a 2009 renovation, doubling the surface area. Some 8,000 works are displayed in the museum, according to the website.
The attack comes the day after Tunisian security officials confirmed the death in neighboring Libya of a leading suspect in Tunisian terror attacks and the killings of two opposition figures in Tunisia.
Ahmed Rouissi gained the nickname of the "black box of terrorism." The information on his death was made public by security officials giving testimony in parliament and cited by the official TAP news agency.
Libya, which has devolved into chaos, is a source of major concern for Tunisia.
Also a major worry is the Mount Chaambi area on the border with Algeria where al-Qaida in the Islamic Maghreb has reportedly been helping a Tunisian group which has killed numerous soldiers.
Elaine Ganley and Jamey Keaten in Paris and Monika Scislowska in Warsaw, Poland, contributed to this report.
Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.