On Friday, a small group of assailants launched an attack near Jerusalem’s Old City. Wielding guns and knives, they killed a female police officer and wounded three other people.

What happened next, though, is a source of controversy. Just hours later, the Islamic State claimed credit for the assault, saying its “soldiers of the caliphate” launched a “blessed operation … on a gathering of Jews.” The terrorist organization promised more of the same in Israel.

Minutes later, however, Hamas rejected that assertion. One of the attackers, the militant group said, was a member.

The other two belonged to the Popular Front for the Liberation of Palestine. Both are Palestinian militant groups fighting what they call an Israeli occupation.

“The three hero martyrs who executed the Jerusalem operation have no connection to Daesh [Islamic State], they are affiliated with the PFLP and Hamas,” Hamas official, Izzat El-Reshiq wrote on Twitter.

The Israeli military said their investigation showed the three attackers, killed at the scene, were residents of the West Bank. Two (both teenagers) came from a village near Ramallah, officials said.

The competing claims of responsibility highlight a major challenge in the era of global terrorism: When tragedy strikes, how do countries figure out who’s really responsible?

Determining responsibility matters because militant groups use attacks like these to spur on followers and spark fear.

Claiming attacks is a key tactic of the Islamic State. Often, the terror group will say it’s perpetrated assaults that aren’t directed by the leadership or even centrally coordinated.

“It creates the perception that ISIS is expanding, even though it’s under attack on multiple fronts in both Iraq and Syria,” Kamran Bokhari, a fellow at George Washington University and senior lecturer at the University of Ottawa, told the Canadian Broadcasting Corporation. “That creates this sort of panic, and that works to the advantage of ISIS.”