JERUSALEM -- A Hamas militant on Sunday opened fire in Jerusalem's Old City, killing one Israeli and wounding four others before he was fatally shot by Israeli police.

It was not immediately clear whether Hamas, an Islamic militant group sworn to Israel's destruction, had ordered the attack or whether one of its members had acted alone. Hamas, which controls the Gaza Strip, has largely adhered to a cease-fire with Israel since an 11-day war last May and shootings attacks inside the Old City are rare.

Police said the attack took place near an entrance to a contested flashpoint shrine known to Jews as the Temple Mount and to Muslims as the Noble Sanctuary. Violence surrounding the site, which is considered holy by both faiths, has triggered previous rounds of fighting, including the war last May.

Israeli officials said Eliyahu Kay, a 26-year-old immigrant from South Africa, was killed in the shooting. Kay had recently worked at the Western Wall, the holiest site where Jews can pray. One of the four people wounded was in serious condition.

Police identified the attacker as a 42-year-old Palestinian from east Jerusalem. Palestinian media identified him as Fadi Abu Shkhaidem, a teacher at a nearby high school.

In Gaza, Hamas praised the attack as a "heroic operation" and said Abu Shkhaidem was one of its members. However, the group stopped short of claiming responsibility for the attack.

"Our people's resistance will continue to be legitimate by all means and tools against the Zionist occupier until our desired goals are achieved and the occupation is expelled from our holy sites and all of our lands," spokesman Abdel Latif al-Qanou said.

Hamas has fought four wars against Israel since it took control of Gaza from the rival Fatah group in 2007.

Israel, along with Egypt, have together maintained a stifling blockade on Gaza since the Hamas takeover, causing great harm to the territory's already weak economy. Since the May war, Israel and Hamas have conducted indirect talks through Egyptian mediators aimed at cementing a long-term cease-fire.

Israel, along with the U.S. and European Union, consider Hamas a terrorist group. On Friday, Britain said it also intends to ban Hamas as a terrorist group and would no longer differentiate between its political and military wings.

Israel's figurehead president, Isaac Herzog, called on other countries to follow suit as he landed in Britain on Sunday for an official visit. "The fact the terrorist was from Hamas `political wing' compels the international community to recognise it as a terror group," Herzog tweeted.

Dimiter Tzantchev, the EU ambassador-designate to Israel, condemned "this senseless attack against civilians. Violence is never the answer."

Sunday's incident was the second of its kind in Jerusalem's historic Old City in recent days. On Wednesday, a Palestinian teen was fatally shot after stabbing two Israeli border police.

Palestinians have carried out dozens of stabbing, shooting and car-ramming attacks targeting Israeli civilians and security personnel in recent years. Palestinians and rights groups contend some of the alleged car-rammings were accidents and accuse Israel of using excessive force.

But shootings around Jerusalem's Old City and its holy sites are relatively rare, and Israel maintains a sizeable security presence in the area.

Israel captured east Jerusalem, including the Old City and its Christian, Muslim and Jewish holy sites, along with the West Bank and Gaza Strip in the 1967 Mideast war. It later annexed east Jerusalem in a move unrecognized by most of the international community.

The Palestinians seek the occupied West Bank and Gaza for a future independent state, with east Jerusalem as its capital.