LONDON  Prime Minister David Cameron offered an extraordinary apology on Tuesday for the 1972 killings of 14 unarmed demonstrators by British soldiers in Northern Ireland, saying that a long-awaited judicial inquiry had left no doubt that the “Bloody Sunday” shootings were “both unjustified and unjustifiable.”

“What happened should never, ever have happened,” Mr. Cameron said in a House of Commons statement. “The families of those who died should not have had to live with the pain and hurt of that day, and a lifetime of loss. Some members of our armed forces acted wrongly. The government is ultimately responsible for the conduct of the armed forces. And for that, on behalf of the government  and indeed our country  I am deeply sorry.”

While the inquiry seemed to settle the issue of responsibility for the killings, the government in London will still have to tackle the difficult question of whether any of the soldiers involved, or their commanders, should be exposed to the possibility of criminal prosecution, or be granted an indemnity, as the opposition Labour Party’s acting leader, Harriet Harman, urged in the Commons in her response to Mr. Cameron’s remarks.

The publication of the 5,000-page report plunged Mr. Cameron, in office barely a month, into the heart of Northern Ireland’s still volatile sectarian politics. Like previous prime ministers going back decades, Mr. Cameron had to tread a wary path for fear of reigniting tensions among Catholics and Protestants in Northern Ireland, who have endured nearly 40 years of bitter dispute over events in the city of Londonderry on Jan. 30, 1972.