(CNN) Gunmen killed 19 people and sent tourists scrambling for cover in a siege at a museum in Tunisia's capital on Wednesday.

The North African nation's Prime Minister called it a cowardly terrorist attack and warned that three suspects were still on the loose.

Tunisian security forces killed two attackers as they ended the hostage siege at the Bardo Museum in Tunis, Prime Minister Habib Essid said. But the death toll, which included 17 tourists and at least one Tunisian security officer, could climb.

Polish, Italian, German and Spanish tourists were among those killed, Essid said, with another 20 foreign tourists and two Tunisians wounded in the attack.

"It's a cowardly attack mainly targeting the economy of Tunisia," the Prime Minister said. "We should unite to defend our country."

The scene played out at a popular tourist destination in the heart of Tunisia's capital in a building linked to where the nation's parliament meets.

Photos: Gunmen attack Tunisian museum Photos: Gunmen attack Tunisian museum People pray at the entrance gate of the Bardo Museum in Tunis, Tunisia, on Wednesday, March 18. Earlier in the day, at least 23 people were killed -- most of them tourists -- when gunmen opened fire in the museum. Hide Caption 1 of 15 Photos: Gunmen attack Tunisian museum A person is taken away on a stretcher outside the museum. Hide Caption 2 of 15 Photos: Gunmen attack Tunisian museum Bullet holes are seen in a bus window near the museum. Hide Caption 3 of 15 Photos: Gunmen attack Tunisian museum A helicopter flies around the museum, which is housed in a 19th-century palace and describes itself as "a jewel of Tunisian heritage." Its exhibits showcase Tunisian art, culture and history. Hide Caption 4 of 15 Photos: Gunmen attack Tunisian museum Tourists are moved away from the scene of the shooting. Hide Caption 5 of 15 Photos: Gunmen attack Tunisian museum Tunisian President Beji Caid Essebsi leaves a Tunis hospital after visiting those injured in the attack. Hide Caption 6 of 15 Photos: Gunmen attack Tunisian museum Security forces patrol around the museum. Hide Caption 7 of 15 Photos: Gunmen attack Tunisian museum The museum is evacuated by authorities. There was a significant number of foreign tourists at the museum at the time of the attack -- something that's not surprising, given its prominence in Tunisia and the fact that at least two cruise ships were docked in Tunis. Hide Caption 8 of 15 Photos: Gunmen attack Tunisian museum A security officer holds his position near the museum. Hide Caption 9 of 15 Photos: Gunmen attack Tunisian museum Security forces secure the area around museum. Hide Caption 10 of 15 Photos: Gunmen attack Tunisian museum Police arrest a man they believed to be suspicious. Hide Caption 11 of 15 Photos: Gunmen attack Tunisian museum Police in plainclothes stop a vehicle as they secure the area around the museum. Hide Caption 12 of 15 Photos: Gunmen attack Tunisian museum Tunisian security forces secure the area around the museum. Hide Caption 13 of 15 Photos: Gunmen attack Tunisian museum Security forces take up position outside the museum. Hide Caption 14 of 15 Photos: Gunmen attack Tunisian museum Police take up position behind a car near the museum. Hide Caption 15 of 15

Lawmakers there were in the middle of a committee meeting when they heard gunfire erupt.

"The tourists were frightened and they were running in different directions. We opened the doors and we got them to enter to the Parliament," lawmaker Mehrezia Labidi told CNN's Christiane Amanpour.

An administrator told lawmakers to lay down on the ground as a gunbattle broke out between terrorists and police, said Sabrine Ghoubatini, a member of parliament.

It wasn't long before the building was evacuated.

Photos on Twitter showed security forces in bulletproof vests and black helmets and masks, guns drawn, in the area. Authorities set up a large security cordon around the targeted museum.

Rescuers carried wounded tourists away on stretchers.

Essid didn't specify where the attackers came from. Interior Ministry spokesman Mohamed Ali Aroui called them Islamists in remarks on national radio.

Who's behind the attack?

The museum, housed in a 19th century palace, bills itself as "a jewel of Tunisian heritage." Its exhibits showcase Tunisian art, culture and history, and it boasts a collection of mosaics, including one of the poet Virgil, as well as marble sculptures, furniture, jewels and other items.

Map: Bardo Museum, Tunis, Tunisia.

No one immediately claimed responsibility for the attack. But it happened just days after a Tunisian jihadist tweeted that a pledge of allegiance to ISIS leader Abu Bakr al-Baghdadi was coming soon, according to the SITE Intelligence Group.

In his message, the jihadi claimed to belong to Jund al-Khilafah in Tunisia, a group that in December pledged allegiance to ISIS, even though that vow didn't seem to have fully registered with the Islamist extremist group. His post comes after an ISIS fighter in Raqqa, Syria , recently appeared in a video questioning why jihadis in Tunisia had not pledged fealty.

"This raises the possibility that the museum attack could be ISIS' debut on the Tunisian stage, timed to precede a pledge of allegiance from Tunisian jihadis for maximum impact," CNN terrorism analyst Paul Cruickshank said.

Tunisia has seen far less militant violence than other nations in the region that were part of the Arab Spring uprisings, like neighboring Libya. But it hasn't been immune to it.

The government has been battling a jihadist presence in the Chaambi Mountains . There have been several apparent political assassinations.

JUST WATCHED Manhunt underway after 17 killed at Tunisia museum Replay More Videos ... MUST WATCH Manhunt underway after 17 killed at Tunisia museum 01:52

And in February, the country's Interior Ministry announced the arrests of about 100 alleged extremists and published a video allegedly showing that the group possessed a formula for making explosives and a photograph of ISIS leader Abu Bakr al-Baghdadi.

Up to 3,000 Tunisians are believed to have traveled to Iraq and Syria to fight as jihadists , more than any other country, according to the International Centre for the Study of Radicalization in London.

"There are hundreds that have returned from the battlefield, yet we haven't seen this kind of activity in Tunisia yet," said Rick Francona, a former U.S. Air Force intelligence officer and CNN military analyst.

"I think it was only a matter of time. And today was the day."

Where Arab Spring took root

Tunisia is where the Arab Spring took root in December 2010, when a poor, 26-year-old man set himself on fire in front of a Tunisian government building after police confiscated his vegetable cart, sparking protests there. Protests throughout the Middle East and North Africa soon followed, with revolutions toppling governments in some countries.

While violence and instability have continued to shake Egypt, Libya and Syria, in many ways, Tunisia has been the exception, with The Economist going so far as to name it "Country of the Year" for 2014.

"The idealism engendered by the Arab spring has mostly sunk in bloodshed and extremism, with a shining exception: Tunisia," the magazine wrote. "... Its economy is struggling and its polity is fragile; but Tunisia's pragmatism and moderation have nurtured hope in a wretched region and a troubled world."

While it has been more peaceful than other countries, Tunisia has seen its share of violence and political turmoil.

There was cautious optimism after the October 2011 elections -- the country's first since its independence in 1956 -- that involved 60 political parties and thousands of independent candidates vying for seats in the country's new Constitutional Assembly.

In 2013, two opposition leaders were assassinated.

But analysts say Wednesday's attack could have been carried out by people who care more about fomenting terror or establishing a strict Islamic caliphate -- ISIS' aim -- than Tunisian politics.

JUST WATCHED Journalist: ISIS proximity a concern for Tunisia Replay More Videos ... MUST WATCH Journalist: ISIS proximity a concern for Tunisia 03:13

The country has also been batting socioeconomic problems such as youth unemployment. Young people who can't get jobs are finding that joining extremist groups like ISIS and al Qaeda is a way out.

Up until now, these recruits have largely done their fighting away from home. Experts think that by taking the fight to Tunisia, they'll hurt their cause not just by hurting the tourism-reliant economy, but also by alienating most of their countrymen.

"They're already isolated and marginalized, and they further isolate and marginalize themselves by these actions," said Mubin Shaikh, a former undercover counterterrorism operative. "... This will just further isolate and alienate these groups from the rest of the public."