In a scene straight out of the Dark Ages, this Somali man accused of adultery was stoned to death by Islamic thugs while horrified villagers were forced to watch.

Mohamed Abukar Ibrahim, 48, was buried in a hole up to his chest and then pelted with rocks by fighters from the rebel group Hizbul Islam on Saturday in Afgoye, about 20 miles from the capital, Mogadishu.

A rebel judge announced that Ibrahim, along with a man who had been accused of murder, had both confessed to their crimes.

The alleged murderer got a more merciful punishment — he was shot to death.

“This is their day of justice,” the judge, Osman Siidow Hasan, told the hundreds of villagers who had been forced to attend. “We investigated, and they confessed.”

Ali Gabow, one of the villagers, told Reuters, “I could not watch.”

“The lady who had been with the second man was only given 100 lashes because she said she had never married.”

The executions marked the first time that Hizbul Islam guerrillas had dealt out the type of punishments usually associated with the more hard-line al Shabaab rebel group in Somalia.

The United States says al Shabaab is al Qaeda’s proxy in the failed African state.