ABUJA, Nigeria — The disputed leader of Boko Haram knows how to cheat death — and do it in style.

After the Nigerian army declared him "fatally wounded" on Aug. 19, Abubakar Shekau appeared in a new video last week to mock the government that has claimed to have killed him at least four times already.

"To the despot Nigerian government: Die with envy. I'm not dead," a man purporting to be Shekau says in the video.

But if Shekau looks untouchable in the fight against the Nigerian army, he has proved much more vulnerable to threats from within his organization. Less than 18 months after he led Boko Haram into a high-profile partnership with the Islamic State, the Iraq- and Syria-based caliphate shunted him aside in favour of a new representative in Nigeria. In an interview published in the Islamic State's propaganda magazine in August, Abu Musab al-Barnawi, the son of the late Boko Haram founder Mohammed Yusuf, was named the new leader of Boko Haram.

Shekau rejected Barnawi's appointment and insisted he was still in charge, setting off a propaganda war between supporters of the two jihadi leaders that raged until Shekau was supposedly killed in an air raid last month. That propaganda war — and the broader struggle for control of the world's most deadly terrorist outfit — has been revitalized with the release of Shekau's latest video, in which he appears in front of an Islamic State flag.

At the heart of Boko Haram's most serious leadership rift in years are fundamental disagreements over ideology, tactics and the group's relationship with the Islamic State. Boko Haram has never been a one-man show. It has always had competing factions led by powerful local commanders who disagree on how to achieve the group's goal of an Islamic caliphate. But these disagreements have hardened since Shekau assumed leadership of Boko Haram in 2009. His ruthlessness and zeal for violence alienated many of his followers, and may even have proved too much for the Islamic State to stomach, prompting the group to replace him with a more conservative leader.

Under Shekau, Boko Haram embarked upon an indiscriminate scorched-earth campaign against anyone — Muslim or non-Muslim — who didn't subscribe to the group's harsh doctrine. Often, the group's handiwork was featured in grisly propaganda videos in which Shekau gleefully took responsibility for kidnapping schoolgirls or slaughtering women and children. The approach invited condemnation from mainstream Muslims, including the Sultan of Sokoto, the spiritual leader of Nigeria's Muslims, who has repeatedly stressed that "more Muslims have died from Boko Haram activity than Christians."

Shekau's tactics also provoked dissent from within Boko Haram's ranks, including from Barnawi, who opposes targeting fellow Muslims. Since being tapped by the Islamic State to lead Boko Haram, he has said, "Attacks on mosques, markets, and other venues belonging to Muslims do not represent IS, they only represent themselves. ... We don't authorize or approve such attacks."

In an audio recording released the same week as Barnawi's appointment, Mamman Nur, another senior Boko Haram commander, rejected Shekau's leadership, claiming he was "ignorant and needs to be taught the rudiments of Islam." Nur said he and other fighters defected from Boko Haram because they did not want to be "part of a caliphate of injustices and shedding of blood."

So aggrieved were commanders like Barnawi and Nur that they reportedly complained directly to the Islamic State's leadership about Shekau's brutality, erratic behaviour and impulsive use of executions to silence internal dissent. It seems likely that these complaints, which raised the possibility of a major split within the Nigerian terror group that would dilute the Islamic State's influence, persuaded the Iraq- and Syria-based group to appoint a new leader.

Fear that Shekau's brutality might threaten the unity of Boko Haram was well founded.

Four years ago, a splinter group calling itself Ansaru defected from Boko Haram and openly complained about the group's targeting of Muslims. Although Ansaru eventually mended fences with Shekau, Boko Haram continued its indiscriminate campaign of terror.

It's no accident that the Islamic State selected Barnawi, whose disciplined and understated demeanour contrasts sharply with that of Shekau, as its new leader in Nigeria. As the son of Yusuf, he has a hereditary claim to leadership. He has also appeared in Boko Haram videos, but none that rival Shekau's trademark brutality — and always with his face obscured.

Given that Shekau hasn't gone quietly into the night, however, the Islamic State may have set the stage for a protracted intra-jihadi fight. The Boko Haram faction led by Nur has made oblique threats against Shekau. In September, there were unconfirmed reports of clashes between rival Boko Haram factions.

Although its internal rifts suggest weakness, the power struggle within Boko Haram is not necessarily good news for Nigeria. Even the most moderate factions remain committed to overthrowing the government. And more factions mean less chance of a negotiated deal to end the bloody insurgency, which has left over 20,000 dead during the last seven years.

Loading... Loading... Loading... Loading... Loading... Loading...

No Boko Haram commander wields sufficient control over the entire group to make all of its factions adhere to a ceasefire or armistice deal. And even if one leader could achieve sufficient consensus, any discussions between Boko Haram and the Nigerian government would require at least tacit approval from the Islamic State.

It seems that there are now different brands of Boko Haram. Some are answerable to the Islamic State's leadership, and others are not. Shekau's uncanny ability to survive means he will likely continue to enjoy the backing of at least some of the group's fighters — regardless of what the Islamic State says.