Tunisian authorities have arrested more than 20 suspected militants in a nationwide security crackdown since gunmen killed 23 people, mostly foreign tourists, in Wednesday's attack in the capital, the government said.

Hundreds of people gathered for a mass in the cathedral in Tunis on Saturday, lighting candles to remember the victims, who included three Tunisians, in a ceremony attended by government ministers.

Outside, there was a heavy police presence along the central Habib Bourguiba boulevard. But Tunis was calm, with a music festival going ahead in the city center.