The former prime minister of Somalia on Thursday ended an eight-year legal battle by accepting legal liability for alleged war crimes and killings that occurred under the regime of dictator Siad Barre. But he denied wrongdoing and said he never approved any slayings.