There were conflicting reports about the cause of the latest clashes, which happened in the northern city of Bauchi.

The BBC said they came after open-air preaching by members of a radical Islamist sect known as Kala Kato, or Giants of the Living, alarmed residents, who complained to the authorities.

Such preaching was banned in the state after the uprising by Boko Haram in July. Fighting sparked by a Boko Haram attack on a police station in Bauchi left more than 700 people dead.

Mohammed Barau, a Bauchi state police spokesman, said the recent violence began with an internal dispute in which members of the Kata Kalo sect accused each other of making their leader gravely ill. Fighting spilled into the street and sect members attacked a military unit, he said. Officials added that the militants had been armed with spears and arrows, while other reports said they had machetes and cutlasses. The officials said at least one soldier and two bystanders, as well as the sect's leader, Malam Badamasi, died in the clashes.

Atikur Kafur, the Bauchi state police chief, said: "All in all, 38 people were killed, including a soldier and two innocent neighbours. Among those killed is the leader of the sect. We made 20 arrests, including nine adults and 11 juveniles, while 14 were injured."

Kafur said bomb-making tools and explosives [and] two AK47 rifles with several rounds of ammunition had been found at the sect leader's premises. A large cache of swords, daggers and gunpowder was also recovered.

Kala Kato has been described as a non-conformist Islamist sect made up of poor tradesmen, labourers and other working people. Uprisings by its members in the northern city of Kano in 1980 and in Yola in 1992 claimed thousands of lives.

There have been periodic bouts of religious violence in Nigeria over recent years. The country is roughly divided into a predominantly Muslim north and a Christian south, but the unrest has generally been motivated by rivalry over resources or local politics.

The Nigerian security forces faced allegations of an over-zealous response to the July uprising, most notably in connection with the death of the Boko Haram leader, Mohammed Yusuf. Nigerian police said Yusuf had been fatally injured while trying to avoid capture, but the commander of the army operation said he had personally captured him alive and handed him to police.

Human Rights Watch in Nigeria called for an investigation into the death of Yusuf, calling it "extrajudicial" and "illegal".