Two IDF soldiers narrowly escaped unharmed after they mistakenly followed Waze into the Kalandiya refugee camp late Monday night.An army source said the incident began around 10:50 p.m.Monday evening, when the two soldiers entered Kalandiya where Palestinian rioters soon surrounded them and threw rocks at their vehicle.“They continued driving, and then firebombs were thrown at them, setting the vehicle on fire,” the source said.The soldiers called for help, escaped their vehicle and fired their guns at the rioters before fleeing in opposite directions.The IDF and Border Police launched a dramatic rescue operation to extract the two Oketz K-9 unit soldiers from the Palestinian area north of Jerusalem.The rescue operation quickly descended into a gun battle, with Palestinians firing on the security forces as they searched for the two soldiers both on the ground and with helicopters.During exchanges of fire, “one of the Palestinian gunmen was shot in the head and killed. He was armed. Others were injured. Our forces sustained a number of injuries, both Border Police and IDF combat soldiers,” Defense Minister Moshe Ya’alon said as he described the incident during a speech to a technology conference in Airport City.One of the soldiers hid in the yard of a home and maintained cellphone contact with the army until security forces found him. The second soldier was able to run out of Kalandiya and up the hill to the nearby Kochav Yaakov settlement.Having left his cellphone in the car, he couldn’t contact the army until he was safely inside Kochav Yaakov around midnight.A military source said the rescue operation was fast and efficient, ending an hour and 15 minutes after the soldiers entered Kalandiya.Palestinian sources said two Kalandiya residents were killed in the fire exchange.Israeli sources said they knew of the one Palestinian gunman who was shot dead, after he shot a Border Police officer in the knee.A total of five Israeli security personnel were injured in the clashes; four lightly, and the fifth – the wounded Border policeman – was listed as being in moderate condition by doctors at Hadassah University Medical Center on Jerusalem’s Mount Scopus. On Tuesday, hundreds of Palestinian mourners attended the funeral of Lyad Abu Omar Sajdiaá, 22, who was killed in the gun battle with the IDF. Sajdiaá studied media and communications at al-Quds University.Palestinians described the incident as an uprising of Kalandiya’s citizens that taught cowardly IDF soldiers who ran away a lesson.An investigation into the incident launched by Binyamin Brigade commander Maj.-Gen. Yisrael Shomer found Tuesday that the soldiers had forgotten to activate the option on the Waze application that prevents navigation into Area A.“This is a human error. Had they activated it, they would not have entered Kalandiya,” an army source said. “We do not blame Waze.”After finding themselves under life-threatening attack, the soldiers responded with the appropriate force, exiting their vehicle and opening fire, the investigation found.“They acted correctly,” the source said.“The fact that they used force when leaving the vehicle prevented the incident from turning into a disaster.”A spokesperson for Waze said the app, by default, is set to prevent routing through areas that are prohibited or marked as dangerous, but that the setting was disabled in this particular incident.The company also said the drivers would have had to pass the large red warning signs that mark the area as prohibited for Israelis.“It’s the responsibility of every driver to adhere to road and traffic signs and obey local laws – in this incident, there were multiple layers of prevention in place,” the company said.The IDF’s Central Command has launched additional investigations.One of the incidents that helped spark the second intifada was the October 2000 lynching of two IDF reservists who accidentally entered Ramallah. In a famous visual from the incident, one of the Palestinians rioters who helped kill them in a police station then stood by the window and held up two bloody hands.More recently, Israeli civilians and soldiers have strayed into Area A in the West Bank, violating the ban on such movements by OC Central Command, sources said. But, in most cases: “We don’t hear about it. It does not usually end with rioting and forces having to go in and extract them. We have had other incidents, in which soldiers and civilians entered Area A and left without riots,” one source said.“Our investigations will ascertain what happened,” the source added.On a daily basis, soldiers are briefed about how to navigate when driving beyond the Green Line, the source said, stressing that soldiers should not solely by relying on navigational applications on their smart phones.In recent months, IDF units carrying out security missions in Kalandiya have repeatedly come under live fire.In December, two terrorists who tried to ram their vehicles into security forces were killed during an IDF raid into Kalandiya. In the previous month, a Givati infantry brigade unit entered Kalandiya and encountered gunfire, pipe bombs and firebombing attacks.Reuters, Niv Elis and Maayan Groisman contributed to this report.