JERUSALEM - The Islamic State group on Saturday claimed responsibility for an attack in Jerusalem for the first time saying it fatally stabbed an Israeli policewoman outside the walled Old City.
But the claim, which came with the jihadists facing defeat in their Iraq and Syria bastions, was swiftly dismissed by Palestinian militant groups.
Three Palestinians attacked officers at Damascus Gate in annexed east Jerusalem late on Friday before being shot dead by security forces, Israeli police said.
In an online statement, IS said jihadist fighters had targeted a "gathering of Jews", warning that "this attack will not be the last".
But Hamas, the Palestinian Islamist group that runs the Gaza Strip, dismissed the claim, saying the attackers had come from among its own ranks and the leftist Popular Front for the Liberation of Palestine (PFLP).
The assault took place as tens of thousands of Palestinians held night prayers at the nearby Al-Aqsa mosque compound, Islam's third-holiest site, on the third Friday of the holy fasting month of Ramadan.
According to police, two assailants opened fire on a group of officers who returned fire, and a third stabbed the border policewoman a short distance away before being shot.
"Female border policewoman injured critically in attack at Damascus Gate," police spokesman Micky Rosenfeld wrote in a statement. "3 Arab terrorists shot by police units that responded at the scene."
Police said the three were killed.
Policewoman Hadas Malka, a 23-year-old staff sergeant major, was taken to hospital in critical condition and later died of her wounds.
- Muddy the waters -
In its statement IS said the attack was "revenge for the religion of Allah and the sanctities of the violated Muslims".
"Let the Jews watch for the demise of their state at the hands of the soldiers of the caliphate," the statement said.
Hamas spokesman Sami Abu Zuhri said the IS claim was an attempt to "muddy the waters", adding that the attack was carried out by "two Palestinians from the PFLP and a third from Hamas".
The killing was "a natural response to the crimes of the occupier," he said, echoing the language used by Hamas after other recent attacks in Israel.
Israel's Shin Bet internal security agency identified the three assailants as Braa Salah, born in 1998, Adel Ankush, born 1999, and Asama Atta, born 1998, all from the village of Deir Abu Mashal near the West Bank city of Ramallah.
The Shin Bet said they had been previously been implicated in "terror activity".
The PFLP said Salah and Atta had recently been released from several months in Israeli prison.
The names differ from those reported by IS, who said the attack was carried out by brothers called Abu al-Bara'a al-Maqdisi, Abu Hassan al-Maqdisi, and Abu Rabah al-Maqdisi.
Medics said four people besides the officer were wounded in the incident. Two of them were Palestinians from east Jerusalem.
A Palestinian from the flashpoint West Bank city of Hebron, initially thought to be a fourth assailant and was shot and wounded, turned out to be an innocent passerby, Israeli police said.
- Ramadan relaxation -
Palestinian Muslims had been flocking from the West Bank to east Jerusalem for Ramadan.
The area around Damascus Gate was sealed off by Israeli security forces in the hours after the attack, with a few youths throwing fireworks at police.
An approach road full of stalls opened especially for Ramadan was closed off by police. A stallholder said it would normally have been one of the busiest nights of the year.
A wave of unrest that broke out in October 2015 has claimed the lives of 272 Palestinians, 42 Israelis, two Americans, two Jordanians, an Eritrean, a Sudanese and a Briton, according to an AFP tally.
Israeli authorities say most of the Palestinians killed were carrying out knife, gun or car-ramming attacks.
Israel occupied Arab east Jerusalem in the Six-Day War of 1967 and later annexed it in a move never recognised by the international community.
It claim the entire city as its indivisible capital but the Palestinians claim its eastern sector as the capital of their promised state.
Saturday was the first time IS had claimed an attack inside Israel or annexed east Jerusalem.
The jihadist group has a major presence across Israel's southern border in Egypt's Sinai Peninsula, where it carries out frequent deadly attacks on the security forces.
It has claimed several rocket attacks from the Sinai into Israel.