Relatives and friends mourn during the funeral of Ari Fuld, 45, an American-born Jewish settler fatally stabbed by a Palestinian, at a cemetery in Kfar Etzion in the occupied West Bank. (Ronen Zvulun/Reuters) (RONEN ZVULUN/Reuters)

JERUSALEM — American-born Israeli citizen Ari Fuld, who was killed Sunday in what Israeli authorities said was a terrorist attack, was hailed as a hero by Prime Minister Benjamin Netanyahu, who paid a surprise visit to the man’s grieving family in the hours before Fuld was laid to rest.

Fuld, 45, who immigrated to Israel from New York in 1994, was a resident of the Israeli settlement Efrat and a well-known pro-Israel activist, prominent in online forums and in the news media.

He was stabbed to death Sunday outside a supermarket at a busy intersection in the Israeli-occupied West Bank that in recent years has become synonymous with such deadly attacks. Paramedics said he died on the way to hospital after chasing and shooting at his 17-year-old assailant.

[Israel says monitoring social media has cut lone-wolf attacks. Palestinians are crying foul.]

The attack was caught on security cameras.

Fuld’s killer was identified as Halil Yousef Ali Jabarin from the nearby Palestinian village of Yatta. He was shot and wounded by a civilian guard. Elders from Jabarin’s village said his mother tried to warn Israeli authorities ahead of the attack but arrived at a military checkpoint minutes too late.

In addition to Netanyahu and other Israeli politicians, thousands turned out to attend Fuld’s funeral late Sunday at the Israeli settlement of Kfar Etzion.

A father of four, Fuld was assistant director at Standing Together, a nonprofit organization providing support for Israeli soldiers. He also regularly engaged in advocacy for Israel known as hasbara, which means “explanation,” but which Israel’s critics describe as manipulative propaganda. Local media reports said Fuld was about to launch an Israel advocacy website in English.

On Thursday, he tweeted that he was gearing up for a U.S. speaking tour touted as “4 keys to destroy all anti-Israel propaganda.” It was his job, he wrote in another post, “to expose the lies about Israel.”

Posting a photo of his meeting with Fuld’s family, Netanyahu tweeted: “I met with the wonderful parents and siblings of the great Israeli hero Ari Fuld. I embraced them in the name of the whole nation of Israel during this terrible time. We owe our lives to heroes like Ari. We must always remember him."

Fuld’s death also drew condolence comments from U.S. officials. U.S. Ambassador to Israel David Friedman tweeted: “America grieves as one of its citizens was brutally murdered by a Palestinian terrorist. Ari Fuld was a passionate defender of Israel & an American patriot. He represented the best of both countries & will be deeply missed. May his family be comforted & his memory be blessed.”

His death also stirred controversy. Critics of Israel debated it on social media, notably his choice to live in the settlement area known to Israelis as Gush Etzion. Some agreed with a critic who tweeted, “An armed settler is a fair target.”

Hamas, the militant Palestinian Islamist group that rules the Gaza Strip, reportedly welcomed the attack, which it said “coincided with the killings of our people during the March of Return,” referring to weekly protests by Palestinians in Gaza at the border fence with Israel.

On Friday, three Palestinians were killed at the border, including an 11-year-old boy. However, later reports suggested that he was not killed by Israeli fire. Since the border protests started in March, about 170 Palestinians have been killed in clashes with Israeli troops, and many more have been seriously wounded.

According to data published by Israeli human rights groups, about 400,000 Israelis live in roughly 150 settlements throughout the West Bank, and an additional 200,000 live in East Jerusalem — land that Palestinians hope will be part of a future state.

[Israel steps up home demolitions to punish Palestinian attackers]

Since October 2015, there has been a steady stream of what authorities call lone-wolf stabbing attacks by Palestinians against Israelis, although the number of such incidents has fallen sharply as Israelis employ tough pushback measures. Among those measures is the immediate demolition of the perpetrator’s family home.

It was unclear whether Jabarin’s home in Yatta would be destroyed by Israeli authorities, given his family’s efforts to sound the alarm. But on Monday, the army issued a statement saying it had “mapped the residence of the terrorist prior to its demolition.”