Follow live news updates on the Israel-Hamas war.

Elon Musk traveled to Israel and met with Prime Minister Benjamin Netanyahu on Monday, touring the scene of a Hamas attack in a visit that appeared aimed at calming the outcry over his endorsement of an antisemitic conspiracy theory on X, the social media platform he owns.

Dozens of major brands suspended their advertising on X after Mr. Musk this month agreed with a post that accused Jewish communities of pushing “hatred against whites that they claim to want people to stop using against them.” The flight of advertisers threatened to cost X tens of millions of dollars, and the White House denounced Mr. Musk for “abhorrent promotion of antisemitic and racist hate.”

On Tuesday, after arriving in Israel, Mr. Musk wrote on X that “actions speak louder than words.” Wearing a flak jacket, he toured Kfar Aza, an Israeli kibbutz where dozens of people were killed during the Hamas terrorist attack on Oct. 7.

Video shared by Mr. Netanyahu’s office showed the two men, accompanied by security personnel, walking through the village in the rain and inspecting the blackened ruins of a house. Mr. Netanyahu said on X that he gave Mr. Musk the tour “to show him up close the crimes against humanity committed by Hamas.”

In a conversation with Mr. Netanyahu broadcast on X, Mr. Musk called the visit to Kfar Aza “jarring” and said he also had been shown footage of the Oct. 7 massacre that he found “troubling.”

Mr. Netanyahu spent the bulk of the conversation explaining the rationale for the war in Gaza. Mr. Musk said in agreement that it was important to “get rid of the ones who are hellbent on murdering Jewish people,” though he also added that it was important to minimize civilian casualties in the enclave. “The rebuttal is often made that, well Israel has killed civilians also in Gaza,” Mr. Musk said. “But there is an important difference here, which is that Israel tries to avoid killing civilians.”

Experts have said that the killing of civilians in the Gaza Strip has been unprecedented when compared to recent conflicts.

Mr. Musk also said it was a challenge to stop “the sort of propaganda that is convincing people to engage in murder,” an apparent reference to the ideology that had fueled Hamas’ attack. Mr. Netanyahu did not raise Mr. Musk’s social media post during the conversation and Mr. Musk did not refer to it, or to the role of X in shaping public attitudes over antisemitism.

But his visit did draw criticism from some who accused the Israeli government of giving Mr. Musk cover.

“Welcoming such a toxic mogul with open arms and taking him around sites of a massacre that has been belittled, demeaned and denied on his watch should be a stain on Netanyahu’s legacy,” wrote Ben Samuels, the U.S. correspondent for the Israeli newspaper Haaretz.

Since Mr. Musk’s post, dozens of major brands including IBM, Apple and Disney have paused their advertising campaigns on X, and the company, which Mr. Musk purchased in October last year for $44 billion, could lose as much as $75 million in advertising revenue by the end of the year. Other major companies, including Amazon, Coca-Cola and Microsoft, have also halted or are considering pausing their ads on the social network, according to internal documents.

Mr. Musk has also faced broader criticism for tolerating and even encouraging antisemitic abuse on his social media platform. He has attacked George Soros, the financier who is a frequent target of antisemitic abuse, and threatened to sue the Anti-Defamation League, a rights group that has highlighted the rise in antisemitism on X.

In May, he likened Mr. Soros, a 93-year-old Holocaust survivor, to Magneto — the X-Men supervillain who has Jewish roots — and said that Mr. Soros “hates humanity.”

That same month, Mr. Musk cast doubt that a gunman behind a mass shooting in Allen, Texas, that left eight people dead had supported Nazi ideology, calling it a “very bad psyop.”

When asked about those comments on CNBC in May, Mr. Musk was defiant. “I’ll say what I want, and if the consequence of that is losing money, so be it,” he said. The company has also said that concerns over antisemitic posts on the platform are overblown.

Mr. Musk has not explained why he visited Israel, but he has had past dealings with its prime minister. In September, he hosted Mr. Netanyahu for an event at a Tesla factory in Fremont, Calif., as both men sought to deflect criticism.

“It’s not an easy thing to be maligned — I know you’ve never seen that, right?” Mr. Netanyahu said during the event.

“Me, maligned?” Mr. Musk responded, laughing. “Never.”

During that exchange Mr. Musk also responded to reports of rising antisemitic content on the social network.

“Obviously I’m against antisemitism — I’m against anti-anything,” he said. “And I’m in favor of that which helps uphold society and takes us to a better future for humanity.”

Following his recent controversy, Mr. Musk posted a similar statement earlier this month, calling news stories that he was antisemitic “bogus.”

“Nothing could be further from the truth,” he wrote.

On Monday, Israel appeared to reach an understanding with Mr. Musk over his proposal this month to deploy Starlink, the satellite internet service he owns, in Gaza for aid agencies to use amid cellular and internet blackouts. Palestinians have blamed Israel for the communications interruptions.

Israel’s communications minister, Shlomo Karhi, said that Mr. Musk had consented not to open access to the system in Israel and in Gaza without the permission of his ministry. “This understanding is vital,” Mr. Karhi wrote on X.

Following his visit, Mr. Musk wrote a post that said, “Trite as it may sound, I wish for world peace.”