Hundreds of Tunisians marched Friday through Tunis, not only marking the 59th anniversary of the country's independence from France but also rallying against terrorism, two days after a deadly attack at Tunisia's national museum.

Wednesday's attack at the National Bardo Museum in Tunis killed 21 people — 17 of them cruise ship tourists — before the two gunmen, who were wearing military-style uniforms, were killed in a firefight with security forces. The Islamic State group based in Iraq and Syria claimed responsibility for the attack.

Tunisian President Beji Caid Essebsi said Friday that Tunisia is "in a war against terrorism."

"We won't win if we don't stand together," he said.

In a statement honoring Tunisia's National Day, U.S. Secretary of State John Kerry said the United States condemned "in the strongest terms the heinous and cowardly attack perpetrated by the terrorists at the historic National Bardo Museum." But he said it "cannot diminish the shining example" of Tunisia and its dedication to democracy.

"The peaceful demonstrations against Wednesday's terrorist attack in Tunis show Tunisian resolve to stand up for the ideas of their hard-fought democratic revolution," Kerry said.

Rafik Chelli, the Interior Ministry's top security official, said the attackers — identified as Yassine Laabidi and Hatem Khachnaoui — had slipped out of Tunisia in December and received weapons training in Libya before returning home. He told the El Hiwar El Tounsi TV channel that authorities did not have further details about where or with which group they had trained.

Confronted with a poor economy, young Tunisians have disproportionately gone abroad to fight with extremist groups in Libya, Syria and Iraq, including some affiliated with the Islamic State. Tunisian authorities have estimated that of the 3,000 young people who left the country to fight with radical groups, about 500 have returned.

Nine arrests reported

Police in Tunisia have arrested five people described as directly tied to the gunmen in Wednesday's shootings, as well as four others in central Tunisia said to be supporters of their cell. At least two family members of Khachnaoui reportedly have been arrested in connection with the attack.

At Tunis' Charles Nicolle Hospital, victims' families continued to arrive Friday to help identify the dead and recover their bodies. Victims included nationals of Japan, Poland, Germany, Italy, Spain and Colombia.

Vatican Radio reported Friday that Pope Francis sent a letter to the archbishop of Tunis, denouncing the attack as an act "against peace and the sacredness of human life" and offering his prayers to the families of the victims, as well as the Tunisian people.

President Barack Obama spoke with Essebsi by phone to offer his condolences, sympathy and support. The White House said Obama offered to keep providing assistance to Tunisia as the investigation proceeded.

European Union leaders also vowed Friday to intensify cooperation with Tunisia to counter the terrorism threat, strengthen its democracy and help with its economic and social development. European Council President Donald Tusk said in Brussels after an EU summit that he planned to visit Tunisia at the end of the month with EU foreign policy chief Federica Mogherini.

In claiming responsibility for the attack, the Islamic State group issued a statement and audio on jihadi websites applauding the dead gunmen as "knights" for their "blessed invasion of one of the dens of infidels and vice in Muslim Tunisia."

Prime Minister Habib Essid announced new security measures Thursday, including a crackdown on websites seen as promoting terrorism.

But analysts cautioned against seeing every such attack as evidence of a well-organized, centrally controlled entity spanning the Middle East, saying instead that small groups could merely be taking inspiration from the high-profile militant group.

"I think [the Islamic State] is probably taking credit for something it may not have played a role in,'' said Geoff Porter, a security analyst for North Africa.

Tourists share stories

Two of the cruise ships that had passengers killed or wounded in the Tunis attack sailed into Spanish ports Friday, with disembarking passengers telling reporters chilling tales of how they just missed being victims.

In Palma, Spanish cruise ship passenger Catalina Llinas told reporters she and her husband luckily chose a day trip Wednesday to the Roman ruins of Carthage near Tunis instead of the museum excursion. The couple's tour bus, she said, passed by the Bardo museum just 10 minutes before the attacks.

"It could have been us," she said.

The deaths of so many foreigners will damage Tunisia's tourism industry, which draws thousands of foreigners to its Mediterranean beaches, desert oases and ancient Roman ruins. The industry had just started to recover after years of decline. The two cruise ship lines who had passengers killed in Tunis on Wednesday announced they were dropping Tunis from their itineraries for now.

Culture Minister Latifa Lakhdar gave a defiant news conference Thursday at the museum, where blood still stained the floor amid the Roman-era mosaics.

The terrorists "are targeting knowledge. They are targeting science. They are targeting reason. They are targeting history. They are targeting memory, because all these things mean nothing in their eyes," she told reporters.