Justice kiosk: Tunisia's alternative law enforcers
For years, the Arab world's dictators kept radical Islamic groups in check, but the uprisings of 2011 gave them freedom to operate more openly. In Tunisia, where the Arab Spring began, a tiny but well-organised minority of fundamentalists, some of them violent, have mounted a major challenge to the state.
As a court of law it didn't look very impressive. Those seeking justice didn't enter through a pillared portico. Instead, they pushed their way past racks of women's dresses. The judge had no chair or desk. He heard his cases standing in a space a couple of metres square, bounded by steel sheeting.
But the judicial system based in a tiny clothes kiosk in the Tunisian town of Bizerte became increasingly popular with local people.
And it posed a serious challenge to the authority of the state.
The informal palais de justice was run by a softly-spoken former jihadi fighter with a long grey beard called Abdesslam Sharif. Using Islamic law, he ruled on all manner of issues.
One well-dressed woman came to try to prevent her husband divorcing her - and keeping the family home for himself and his mistress.
The parents of a 14-year-old boy brought a man they accused of taking their son's mobile phone - and trying to seduce him.
Even a retired policeman preferred Abdesslam's justice to that of the state, asking him to remove a tenant from his flat.
In each case, Abdesslam and his followers solved the problem with an efficiency many say the state can't match. The woman and her husband stayed together. The boy got his phone back - and his alleged pursuer now rarely leaves his home. The tenant was "threatened" - it's not clear how - and moved out.
But for the authorities, it was Abdesslam himself who was the problem. And in June they solved it - by bulldozing his unofficial law court.
All that remains now of his kiosk are a few scraps of twisted steel embedded in the pavement. Abdesslam himself has fled - some say to Libya, some say to Mali.
But the threat he posed to the state hasn't completely gone away.
Abdesslam is a Salafist, part of a fast-growing movement among Sunni Muslims worldwide who believe Islam should be practised as it was by the first followers of the Prophet Muhammad in the earliest days of the faith.
Long repressed by dictators in many Arab countries, they've been able to operate openly in Tunisia, Libya and Egypt since the uprisings of 2011.
Most Salafists reject violence as a way of spreading their beliefs. But in Tunisia a small number - a minority within a minority - became increasingly dangerous.
Last September, a Salafist mob stormed the US embassy in Tunis.
In February, Salafists were accused by police of assassinating the secular opposition leader, Chokri Belaid. A second politician, socialist Mohamed Brahmi, was shot dead last week. The interior ministry says the same gun was used in both murders.
In Bizerte, the violence was less visible, but regular, as Salafist vigilantes formed patrols that operated as an unofficial police force, imposing Islamic morality.
In one incident recorded by BBC Arabic, who spent two months filming a documentary in Bizerte, Salafist youths surrounded a man they suspected of being drunk - and one beat him with a metal chain.
Another man, his head badly bruised, who didn't want to be named, said he was drinking beer in a car with a friend when about 20 Salafists dragged him out and attacked him with swords.
He said: "They were shouting "Allahu akbar" and the swords were coming down on my head and face. I tried to protect myself with my hands - that's why I have all these cuts on them."
BBC Arabic also filmed a suspected drug dealer being questioned by Salafists on a Bizerte beach. But they were not allowed to see the moment the patrol first detained him. The Salafists denied hitting the man - though he showed signs of having been beaten.
But Salafists in Bizerte and other towns are now operating much more discreetly.
Police say they've arrested about 60 of them in Bizerte - and about 2,000 across Tunisia - on specific offences, including violence in the last few months.
The crackdown started in earnest when the government banned a Salafist conference in the city of Kairouan in May. Tear gas was used to disperse youths who hurled stones at the police in protest.
Interior Ministry spokesman Mohammed al-Aroui said: "After the revolution, law and order broke down. We had to regain control, step by step. The state was under threat - some groups tried to overpower it. That forced us to act, to put things back to how they were before, to make Tunisia for all Tunisians again."
For the moderate Islamists of Ennahda, the Rebirth Party, who've governed Tunisia since its first free elections in 2011, dealing with the Salafist challenge has required a delicate balancing act.
Tunisia is a relatively liberal society where Ennahda must reassure secularists to avoid the risk of being overthrown, as the Muslim Brotherhood has been in Egypt. But it must also keep the loyalty of its own religious constituency.
Bizerte - Tunisia's northern-most port, long open to other cultures - seemed an unlikely place for Salafists to mount one of their most serious challenges to the state.
But in its poorer suburbs, the social problems that have contributed to the spread of Salafism remain.
"Since the revolution, Tunisia has sunk deeper and deeper," said Ibrahim Trabelsi, a young Salafist who sells second-hand American clothes in a market."
"Everything is more expensive now. There are fewer jobs. A lot of factories have closed. Tourists are scared off now because maybe they think there is terrorism and violence here."
In such areas, Salafists help provide jobs and Islamic schooling, and distribute alms to the poor - as well as attracting people though their simple justice system.
One new adherent to the movement, local café-owner Salah Badrouni, joined after Salafists found and brought back property that had been stolen from his premises. Now he offers his customers impromptu Salafi sermons along with their coffee.
"There is no retreat," he said. "We're still going forward. Maybe we can't do as much charity work now, and we meet less often, because some of our leaders have had to leave Tunisia. But even if we've had a setback, our sons will continue our path. Islam will keep pursuing its purpose. It won't be stopped by anything or anyone."
You can see BBC Arabic's film, The Battle for Bizerte, on BBC World on Saturday 17 August.