MOGADISHU, Somalia | Men are forced to grow beards. Women can't leave home without a male relative. Music, movies and watching sports on TV are banned. Limbs are chopped off as punishment, and executions by stoning have become a public spectacle.
Somalia is looking more and more like Afghanistan under the Taliban — two rugged countries 2,000 miles apart, each lacking a central government, each with a hard-line Islamist militia that cows the public into submission.
The tactics of al-Shabab in Somalia and the Taliban in Afghanistan increasingly mirror each other. Those tactics worked for the Taliban until the U.S. invasion overthrew it in 2001, and now they are making a comeback. Meanwhile, al-Shabab has gained control over large swaths of this arid Horn of Africa country.
In the latest adoption of tactics long used by the Afghan militants, al-Shabab is ordering households in southern Somalia to contribute a boy to the militants' ranks. Childless families have to pay al-Shabab $50 a month. That's Somalia's per capita income.
An al-Shabab commander attributed the shared tactics and ideology to the fact that both groups follow a strict form of Islam.
"One more thing we deeply share is the hatred of infidels," the commander, Abu Dayib, told the Associated Press.
Some experts say the similarities are no accident.
"Al-Shabab is copying exactly whatever the Taliban was doing in the late 1990s, because they think the strategies the Taliban employed in Afghanistan were successful," said Vahid Mujdeh, the Afghan author of a book on the Taliban. "There is no doubt that the Taliban are like heroes for al-Shabab."
U.S. and other security officials worry about another common thread: Both the Taliban and al-Shabab have links to al Qaeda.
Until their overthrow, the Taliban gave Osama bin Laden and his group safe haven in Afghanistan. Many analysts believe al-Shabab is now controlled by al Qaeda-linked foreign fighters who honed their skills in Iraq and Afghanistan.
Last month al-Shabab claimed its first international attack — twin bombings in Uganda that killed 76 people watching the World Cup final on TV. Uganda said at least one of the confessed participants belonged to al Qaeda. Simultaneous attacks are an al Qaeda hallmark.
Both the Taliban and al-Shabab moved into a power vacuum left by inconclusive civil war, and were initially welcomed by publics desperate for some form of law and order. What they got was an extremely harsh penal code.
Now the Taliban is gaining ground despite NATO forces' efforts to push it back, and brazenly advertised its clout this month by stoning a young couple stoned to death in front of a crowd, allegedly for committing adultery.
In Somalia, two months ago, al-Shabab accused Ahmed Ali Shuke, a 27-year-old laborer, of being a government spy and slashed his tongue.
"Both groups derive support from followers of their strict interpretations of Shariah [Muslim law]. Both groups also derive support by terrorizing the population," said Letta Tayler, a counterterrorism specialist at Human Rights Watch. "The people of Somalia, as in Afghanistan, have learned the hard way that if they speak out against these groups' practices, they will get killed."
Both the Taliban and al-Shabab win some sympathy by positioning themselves as defenders against invading infidels. Foreign forces — African Union troops in Somalia, U.S. and NATO forces in Afghanistan — feed into that narrative when they kill civilians during raids, Ms.Tayler said.
"Even many Somalis who don't like the Shabab's ideology are immensely thankful for the drop in crime in many areas under the group's control. Their daughters are not raped. Their crops are not stolen en route to market," she said.
But Human Rights Watch said in an April report that the stability was achieved by "unrelenting repression and brutality."
Several women told Human Rights Watch that they had been flogged or jailed for selling tea to support their families because the work brought them into contact with men.
Somalia has had no functioning government since 1991, and militants with guns have been filling the void ever since. Al-Shabab, which the U.S. branded a terror group in 2008, is believed to have several thousand members.
Hundreds of its fighters have died in battle, forcing al-Shabab to increase recruiting among young men and boys, said Ali Mohammed, a retired Somali colonel.
They are "losing the hearts and minds of the ordinary people," he said.
In turn, families in militant-controlled areas of Somalia send their sons away, several parents told the AP.
"I have lost one of my sons in a battle he was forced to join in central Somalia three months ago. He was only 15," said Asha Mohamed Amin, who lives in a rebel-controlled area of Mogadishu, the capital. "Again they say contribute the other [son] to a senseless death. Is that acceptable?"
Ms. Amin said she sent her other son to Hargeisa in northern Somalia to live with friends.
A 26-year-old woman named Ubah felt al-Shabab's brutality firsthand.
She was visiting a moneychanger in the southern town of Kismayo with a male cousin when two young militants accused them of engaging in an illicit relationship after they couldn't show proof they were related. Hours later the militants whipped Ubah and her cousin — 80 lashes for the man and 50 for Ubah.
"I was crying and I thought they would never release me," Ubah told AP, asking that her last name not be used for fear of militant reprisals. "I couldn't move because there were men with guns."
She said the militants warned that if the two were seen together again they would be stoned to death.