Around lunchtime, the crackle of gunfire broke the leisurely calm of a visit to one of Tunisia's best-known museums: Two attackers went on a rampage targeting tourists. By the end, after police traded fire with the gunmen and special forces barreled in, the duo and 21 others were dead.

Tunisia's deadliest terror attack in more than a decade jolted locals out of their daily routines and took the cherished lives of visitors who make up a major breadwinner for the democracy-minded North African country of 11 million, according to accounts from witnesses, victims and a police official.

Wednesday's attack at Tunis' National Bardo Museum, claimed by the Islamic State group that has sought to spread its bloodthirsty influence beyond its base in Syria and Iraq, drew immediate condemnation from many world leaders and promises from Tunisian officials and citizens that they won't bow to terror.

For Mohamed Ali, an unemployed 42-year-old father of four who lives in the Bardo district, the episode upended a family stroll to the zoo. Looking in through a high fence around the museum grounds next to parliament, he saw men pull automatic weapons out of bags and calmly walk inside, opening fire on tourists either inside a bus or emerging from it.

"There were police on one side of the bus that they set upon, and the terrorists were hiding on the other side," he told The Associated Press in an interview in the popular La Gazelle cafe across the street a day after the attack. "There was an exchange of fire, and the gunmen took refuge in the museum."

A police captain, speaking to the AP, recalled how at 12:17 he heard the rat-a-tat of repeated shots and rushed to the museum entrance, where a woman lay injured on the stone-tile floor and two other people were strewn on an adjacent lawn.

Inside, many museumgoers had little or no place to hide. Some tucked behind thin columns, or cowered on the floor. One French visitor with a bandaged knee, speaking afterward to France 2 Television, said she'd only survived because a person in front of her took a bullet to the head.

The 50-year-old captain, in a police ball cap and three shiny stars on the breastplate of his bulletproof vest, said at least one assailant made his way to the roof. The captain and at least one one of his colleagues fired upward to give cover to a police car that hurriedly took away a visitor who had been shot in the hip.

On watch again Thursday as several hundred people rallied outside the museum to denounce and defy terrorism in Tunisia, the officer stepped away to collect himself with a cigarette. His eyes welled up when he thought of helping four injured visitors into emergency vehicles, leaving blood on his hands.

The officer said he couldn't aim his gun well because his main concern was protecting the injured. He declined to provide his name, insisting he was doing his duty and did not want to be publicly associated with the incident.

Police cars and ambulances rushed in, and a helicopter soared overhead. Special forces — with their armored vehicle crunching two track-like welts into the floor tiles — were next. Aside from the attackers, the only other Tunisian killed was a special forces officer that the captain said had recently become a father.

By varying accounts, the end of the siege lasted no more than an hour or so, and special forces gunned down the attackers inside. Scores of tourists — some parents carting small children — scurried up the steps of a nearby building to take shelter.

One Spanish couple, Juan Carlos Sanchez and Cristina Rubio, had holed up in a small room in the museum, where they had fled after he spotted a fleeing man, and spent the night there on the idea that the gunmen might still be around. Rubio, who is pregnant, was uninjured and told Tunisia's health minister at a hospital maternity ward that tests showed that the girl on the way was ok.

Seventeen of the 20 foreigners who were killed had been cruise-ship passengers. Health Ministry officials said Japanese, French, Italian, British, Polish, Spanish, Australian, Polish and Belgian citizens were among the dead, and several remained identified.

It was the deadliest terror attack in Tunisia since an al-Qaida militant set off a truck bomb outside a historic synagogue on the resort island of Djerba in 2002, killing 21 people — mostly German tourists.

Tunis resident Mohamed Aziz Smiri said he saw the evacuation from the museum, and heard police assurances that the situation was under control. He noted that extremists had generally attacked security forces in Tunisia's rural west near Algeria in recent years.

"Every time they kill Tunisian security forces, and now tourists," he said. "It's haram (a sin), they came as guests to our country. I didn't want that for them, it makes me feel sorry, we're sad ... What did they do to us?"