Updated

Somalia's most powerful militant group is teetering on the brink of a major split because of a rift between its top two leaders, a feud that could erode the size and strength of the al-Qaida-aligned group.

The rift inside al-Shabab is over political strategy and clan rivalries, fueled by the group's two top leaders' very different outlooks.

Al-Shabab was formed in 2007 out of a desire to unite warring clans. Now clan loyalty may be tearing the group apart.

Leader Sheik Mukhtar Abu Zubayr is a hardline Islamist from Somalia's north who has welcomed foreign fighters with experience in Iraq and Afghanistan and favors harsh punishments like public stonings and amputations to subdue dissent.

The group's deputy, Sheik Mukhtar Robow, is a southern nationalist who disagrees with Abu Zubayr's decision to force out international aid groups and U.N. agencies from Somalia. Associates of Robow told The Associated Press that he believes harsh punishments turn average Somalis against the group.

Fallout from the feud has already been felt across Somalia. Robow supporters have moved out of some neighborhoods in the capital, Mogadishu, and from the important southern port city of Kismayo.

African Union peacekeepers who are defending the weak interim federal government have claimed advances in Mogadishu in recent days — gains that could be credited in part to disarray among al-Shabab fighters on the front lines. Residents say whip-wielding militants are no longer patrolling through the city's biggest market, Bakara.

Robow comes from the Rahanweyn clan, which dominates southwestern Somalia. If he breaks ties with Abu Zubayr, the foreign fighters and Abu Zubayr's men may have to relocate to new sanctuaries where the Hawiye clan dominates. But the Hawiye have not yet picked sides, said Abdirahim Isse Adow, director of the government-run Radio Mogadishu.

"Al-Shabab is deeply troubled and has been for sometime," said Rashid Abdi, a Somalia expert with the International Crisis Group who says the fragile U.N.-backed Somali government should capitalize on al-Shabab's rifts. "The group has been resilient, but its longevity is now under serious threat."

Robow's and Abu Zubayr's aides did not respond to requests for comment.

Abu Zubayr has in recent days threatened to remove Robow from al-Shabab's consultative council if he continues challenging his leadership, Robow's associates said.

Abu Zubayr and Robow have been at loggerheads frequently but the current row has been strained by the group's anti-government offensive in Mogadishu in which Robow's Rahanweyn clan bore the brunt of the casualties. The offensive that began on Aug. 23 was aimed at dislodging the weak Somali government and the African Union peacekeepers that protect its small, seaside enclave in Mogadishu.

A Rahanweyn clan elder said his tribe suffered the most casualties and that Robow was angered after visiting wounded fighters in Mogadishu hospitals. The elder, like other Somali officials connected to the insurgency, spoke to AP on condition they not be identified because militant leaders could punish them for speaking about troubles within the insurgency.

Rahanweyn elders have long demanded that Robow explain why the bulk of al-Shabab fighters are from their clan but most of the group's influential positions are filled by northerners.

The al-Shabab fissure could be a boon for Somalia's other major rebel group, Hizbul Islam, as well as the African Union and Somali government. Robow has strong ties with Hizbul Islam's leader.