DAHRIYA, West Bank — The Palestinian doctor was on his way to Jerusalem to join in Ramadan prayers when he made a decision that many in Israel found inspiring: He helped save the lives of Jewish settlers.

Dr. Ali Shroukh, 45, was driving with his brothers along a West Bank road on Friday when they came upon a car that had flipped over onto its roof. The vehicle — big and boxy, with room to fit many children — seemed easily identifiable as belonging to a Jewish settler.

The car had crashed after a Palestinian gunman fired on it, killing the driver, Rabbi Michael Mark, 46, a father of 10. His wife was critically injured, and one of the two children in the car, a teenage girl, was seriously wounded. The family was on its way to Jerusalem to visit Rabbi Mark’s mother.

Dr. Shroukh did not realize that he was witnessing the aftermath of a terrorist attack. His instinct was simply to help.