Israeli police say a knife-wielding Palestinian attacker sneaked into a Jerusalem police station and lightly wounded four police officers.

Police spokesman Micky Rosenfeld says the attacker climbed over the station's fence and began stabbing people inside. The incident happened on Wednesday night.

Rosenfeld says other officers shot the assailant and captured him. He was taken to hospital.

An Israeli border police officer sits in an ambulance in Jerusalem, early Thursday, Nov. 15, 2018. Police said they arrested an assailant who stabbed and lightly wounded an officer in the station, located in the Armon Hanatziv neighborhood. (AP PhotoMahmoud Illean)

An Israeli border police officer sits in an ambulance in Jerusalem, early Thursday, Nov. 15, 2018. Police said they arrested an assailant who stabbed and lightly wounded an officer in the station, located in the Armon Hanatziv neighborhood. (AP PhotoMahmoud Illean)

The attack came as a fragile truce was reached between Israel and Islamic militants in Gaza that ended two days of heavy fighting. It was the area's most severe violence since the 2014 Gaza war.

Palestinian militants had fired 460 rockets and mortars into Israel, while Israel carried out airstrikes on 160 Gaza targets. Seven Palestinians, including five militants, were killed. A rocket fired from Gaza killed a Palestinian laborer in Israel.