SYDNEY, Australia — Papua New Guinea’s prime minister, Peter O’Neill, has vowed to repeal the country’s controversial Sorcery Act after the latest in a string of brutal public killings of people accused of practicing black magic.

According to Amnesty International, violence against those accused of sorcery is endemic in the South Pacific island nation. In the most recent case, an elderly former primary school teacher in the autonomous Bougainville region was decapitated by a mob whose members accused her of using witchcraft to kill a colleague. Three other women, all relatives of the victim, were also injured in the episode.

Mr. O’Neill, responding on Thursday to a question from a reporter about that killing, pledged to repeal the 1971 Sorcery Act, which criminalizes the practice of sorcery and recognizes the accusation of sorcery as a defense in murder cases. Critics of the law say that it encourages violence against people accused of being sorcerers by codifying black magic as a legal phenomenon.

“We have quite a lot of issues on the table, so please give us a chance to work on it,” Mr. O’Neill told the reporter. “Realistically, a few sessions away, we will be able to put an act to Parliament to stop this nonsense about witchcraft and all the other sorceries that are really barbaric in itself.”