The jihadis carried out amputations in the sandy square where the residents of Gao used to watch basketball. The men who ruled Gao for nine months, until French and Malian troops drove them out last weekend, replaced the words "Place de l'Indépendence" in the green, red and yellow of the national flag with simple white on black: Place de la Sharia.

A thief would lose his right hand. Those accused of burglary would lose both their right hand and left foot. On 21 December last year, people were assembled, as they had been several times before, and told to watch.

"No one was allowed to speak," said Issa Alzouma. "Then they cut off my hand with a knife."

Alzouma had been accused of stealing a motorbike, which he denies. At 39, he made a living digging gravel for construction companies. It was enough to support his wife and three children. Now he roams Gao in tattered clothes, the stump of his right arm wrapped in a grubby bandage, a flimsy black plastic bag dangling from his remaining wrist. Inside he keeps a few antibiotics and replacement bandages given by a Red Cross doctor who treated him at Gao hospital a week after his amputation.

"The doctor had to cut in and remove flesh because it was infected," he said. "Under the bandage you can see my bones. It hurts and I feel as if my bones are coming out."

Alzouma has no idea how he and his family will survive. "My wife just cries and cries," he said. His friend Algalas Yatara, who was also accused of stealing a motorbike, carries a sheaf of papers in Arabic in his remaining hand. He thinks it is the judgment but is not quite sure, as neither man can read Arabic.

At least 12 men had hands or feet cut off after MUJAO (Movement for Jihad and Unity), and its allies in AQIM (al-Qaida in the Islamic Maghreb), took control of Gao last April. The exact number is not known because some were amputated in the military base where no non-jihadi were allowed. The mayor's office, a few yards from the punishment ground, was turned into a sharia court. Outside, the sand has turned black where the enforcers of hesbah, or justice, ground down cigarettes and whipped those found smoking. Inside, the floor is littered with documents, including a ring-binder with details of women flogged for not wearing the veil. Family members were made to put a thumbprint to show they acknowledged the punishment and would supervise the accused in future.

Credit: Observer graphics

Suspects were confined to a small room where they were tied up and beaten, before being brought before Islamic judges, known as marabous, who sat every Monday and Thursday.

Ali Altini and Mohammed Aklini were due to be executed for homosexuality the Friday before last. French air strikes saved their lives, as the jihadis who would have carried out the sentence were killed or fled. The two men, who deny they are gay, were arrested on 12 December, bound, beaten, then interrogated. "They asked me where the brothels are," said Altini. "I answered that I didn't know. Then they asked me to show them where people made pornographic movies. I answered again that I didn't know."

According to Altini, his six interrogators were Pakistanis, who communicated through a local translator. Altini and Aklini were arraigned before three marabous, one of whom they believed to be a Tunisian.

"The jihadis had their own marabous," said Altini. "They asked me if the rumours that I slept with men were true. They said that before the time of the Prophet such things were allowed, but now it is condemned by Islam." One marabou suggested that the men should be given a second chance, but another said they should be executed. The final decision seems to have been taken by Abdul Hakim, a Moroccan who was MUJAO's leader in Gao, and Aliou Muhammar Touré, a local man who was appointed Islamic police commissioner.

"Abdul Hakim and Aliou Muhammar came to visit us in the police station after the judgment," said Altini. "Aliou said: 'I will tie their hands and feet myself.' Abdul Hakim replied: 'Well, I will cut their throats myself.' Aliou wanted my parents to witness the execution."

According to Gao residents, the victims of sharia punishments were from Mali's black African ethnic groups, while the jihadis were mostly lighter-skinned Arabs – both Malian and foreign – and Tuaregs. Aliou Muhammar Touré, of the Songhai tribe, was one of the few black Malians to join MUJAO.

"If you are a Tuareg or Arab, or if you look like them, they don't threaten you," said Alzouma, the amputee, who is from the Bella, the group traditionally used as slaves by the Tuareg. "Their people smuggle drugs, cigarettes and everything, but they don't threaten their own families, just black people – the Songhai, the Bella and the Bambara."

A year ago Tuaregs rose to demand an independent state in the north. Many Tuareg officers deserted the army to join the rebellion. Some joined forces with jihadis, mostly Algerian or Malian Arabs, who were using the desert for kidnapping and smuggling. During the past nine months, in which they established an Islamist mini-state, jihadis from across the globe arrived in northern Mali.

Ethnic tension has already led to reprisals. Graphic footage shows a mob tearing a jihadi fighter limb from limb. A vigilante group calling itself the Patrollers of Gao is combing the town for members of MUJAO. Last week they seized and beat several men in the marketplace, and one who was hiding in the hospital. Malian soldiers rescued the men, but they too speak with vitriol about those they see as traitors, especially the Tuareg. "We invited them into our homes and ate with them, but they turned their guns on us," said a senior army officer in Gao. "How can we trust them again?"

In the past few days, the mayor of Gao, who returned from the capital, Bamako, last Sunday, has used local radio to call for tolerance and the rule of law, but neither the police force nor local administration has yet been reinstated.

Lindsey Hilsum is international editor for Channel 4 News