A Jewish gunman shot and wounded two Palestinians in East Jerusalem on Friday, and police arrested the suspect at the scene, a police spokesman said.

Shmuel Ben-Ruby, an Israeli police spokesman in Jerusalem, said the gunman shot and wounded a 13-year-old boy and a 40-year-old man from Silwan, a mostly Palestinian neighborhood.

Both were injured lightly in the legs, he said. The victims were taken to a local hospital for treatment.

Police said they are interrogating the shooter, whom they identified as a 20-year-old off-duty Israel Defense Forces soldier.

An initial police investigation revealed that the shooter claimed he opened fire in self-defense after being attacked by a group of six Palestinians.

Relatives of one of the wounded attacked a security guard and a nurse at Jerusalem's Hadassah Ein Karem Hospital later Friday night after trying to bring one of the wounded there for treatment, Army Radio reported. Nobody was injured in the incident.

Palestinians protested the shooting by throwing stones at police and some Jewish homes in the nearby neighborhood of Silwan. Police were sent to contain the violence, Ben-Ruby said.

Tensions have flared recently between Jews and Palestinians in Jerusalem since Israel's recent removal of two Palestinian families from their homes after a court order, and its threats to demolish other houses Israel says were built without permits.

Israel annexed East Jerusalem as part of its capital after capturing it during the 1967 Six-Day War. Palestinians also claim the city as the capital of a future state.