The security officers represented nearly the full rainbow of Israeli society — an Arab and two Israeli-born Jews, one of Ethiopian descent.
Their deaths Tuesday in a shooting attack by a Palestinian man — a father of four described warmly by a shocked Jewish employer — struck a powerful chord in Israel and the West Bank, where the killings marked the deadliest outbreak of violence in months.
According to police, the shooting, witnessed by dozens of people, took place at the entrance to Har Adar, a prosperous suburb of Jerusalem that straddles the 1967 line between Israel and the West Bank.
The Palestinian, identified as 37-year-old Nimr Mahmoud Ahmed Jamal, was among West Bank workers crossing into Israel early Tuesday when he was stopped by security officers. Although they were familiar with Jamal, authorities said, they became suspicious because he was dressed warmly for the season and was behaving oddly.
When asked to step aside, authorities said, he pulled a gun from under his clothing and began shooting. The security officers returned fire, killing him, officials said.
Besides the three officers who were killed, a fourth guard was severely injured but is expected to recover.
The victims of the attack were hailed as heroes by the police, who said the town was spared a significantly worse outcome. They said Jamal, who was from the neighboring village of Beit Surik, was a daily visitor to Har Adar, where he cleaned houses, and could have slipped by a less vigilant security team.
The attack was immediately applauded by Hamas, the Palestinian militant group ruling the Gaza Strip. Hamas spokesman Hazzam Qassam saluted "the terror attack" as "a new chapter in the Al Quds intifada," referring to a wave of Palestinian shootings, stabbings and car rammings that began two years ago but has waned.
Friends in Har Adar and Israeli security forces described Jamal as a troubled man whose wife had recently fled to Jordan, leaving him to care for the couple's children. He had no history of terrorist acts or criminal behavior. He left a note in Arabic, released by the Israeli army, in which he said that he had "behaved badly" and that his wife bore no blame for "what will happen tomorrow," apparently referring to the shooting.
Moish Berdichev, a Jewish resident of Har Adar who employed Jamal as a house cleaner and said he had known him for years, told Israeli media: "I had long heart-to-heart conversations with him about the situation with his wife, and the kids. It's hard. It was hard for him. We had long talks about coexistence, even about cleavages in Israeli society, tensions between the right and the left. He was part of us. He ate at my table and shared glasses with us."
In remarks to his Cabinet, Israeli Prime Minister Benjamin Netanyahu said, "This murderous attack is the result of ... systematic incitement by the Palestinian Authority and other elements and I expect Abu Mazen to condemn it and not attempt to justify it."
Abu Mazen is the nickname of Palestinian Authority President Mahmoud Abbas.
The three security guards were buried later Tuesday.
Yussef Othman, 25, an Israeli Arab, was laid to rest in his home village of Abu Ghosh, next to Har Adar. His father, Issam, said Othman was "a wonderful son who loved to help everyone," and "a man of the law" who did not discriminate against anyone. The killers, he added, "are not of my people."
Othman's funeral, at the local mosque, was conducted in Arabic and English.
Or Arish, also 25 and a Jewish resident of Har Adar, was a former paratrooper who started his job as a security guard two months ago, intending to save money for college. His parents, local restaurateurs, asked journalists to refrain from covering his funeral.
Chen Filipovich, the head of Har Adar's Regional Council, who knew Arish and Othman personally, described rushing to the scene only to find "a horrible sight." Speaking to a radio interviewer, he said: "I'd just talked with Yussef. We were always in coordination. I hugged them and covered them and said goodbye."
The third man killed was Staff Sgt. Solomon Gabariya, 20, the Israeli-born son of Ethiopian immigrants, who survived a previous attack on border police officers in October.
Thousands attended his evening funeral. "He was the salt of the earth; a true patriot," said Nissim Gozlan, mayor of the southern Israeli town of Beer Yaakov, where Gabariya lived. In an emotional interview with Israel's Army Radio, Gozlan described Gabariya as a local standout, a cheerful student who excelled in high school and was determined to serve his country.
Jason Greenblatt, President Trump's special representative for international negotiations, landed in Israel hours before the attack for a renewed effort at reviving the Israeli-Palestinian peace talks, which have been moribund since 2014. He tweeted his reaction to the attack.
Israel's ethnic mosaic was also put into stark relief by a highly anticipated political event ultimately overshadowed by the day's news.
Shakib Shanan, a former member of the Knesset, Israel's parliament, whose son was one of the two border police officers killed July 14 while guarding Jerusalem's Al Aqsa Mosque, addressed his former colleagues to testify against Netanyahu's "Nationality Law," a controversial bill that if passed, will define Israel as a "Jewish state."
Shanan is a member of Israel's Druze minority. "Don't bury us outside the cemetery," he said. "We love this country."
Tarnopolsky is a special correspondent.
2:55 p.m.: This article has been updated with details, quotes, attacker's note.
11:40 a.m.: This article has been updated with the suspect being killed.
11:15 a.m.: This article has been updated throughout with staff reporting, quotes, details.