SAN FRANCISCO — After the stabbing death last week of Bob Lee, an entrepreneur and creator of Cash App, in a San Francisco neighborhood popular among technology workers, prominent tech executives including Elon Musk tore into the city’s leaders.

Matt Ocko, a venture capitalist, said San Francisco officials had Mr. Lee’s “literal blood on their hands.” Others suggested that homelessness and violence run amok were to blame.

But that narrative was upended on Thursday when the police arrested Nima Momeni, who they said knew Mr. Lee and worked in the same industry. Ever since Mr. Momeni was identified, other voices in the tech world have hit back at those who used Mr. Lee’s death to malign the city on social media.

“I suspect we’ll find that this story doesn’t represent anything universal about the great city of San Francisco,” said Jeff Lawson, chief executive of the tech communications company Twilio, whose offices are just a few blocks from where Mr. Lee was killed. “Rather, it is a tragic aberration, the result of an interpersonal conflict — the kind that can happen in any city and time.”

Mr. Lee was killed in an upscale neighborhood called Rincon Hill, which sits between Oracle Park, home of the San Francisco Giants, and a quiet area near the bay that houses offices for companies like Google, Meta and Salesforce. San Francisco was a city he loved, Mr. Lee’s brother, Oliver Lee, said on Thursday, adding that the moves to critique the city in light of his death “wouldn’t have been like him.”

As news of his killing spread last week, some technology entrepreneurs and venture capitalists based in the Bay Area concluded that San Francisco’s approach to crime and homelessness had led to his death. Many of them blamed San Francisco’s board of supervisors and Chesa Boudin, the former district attorney who was ousted in a recall vote last year.

Jason Calacanis, a tech investor and podcaster, tweeted a video of Kevin Benedicto, a San Francisco police commissioner, in which the official cautioned against falling into a “preconceived narrative” about a “horrifying act of violence.”

“THESE ARE THE LUNATICS RUNNING SAN FRANCISCO,” Mr. Calacanis wrote with the video. “EVIL INCOMPETENT FOOLS & GRIFTERS WHO ACCOMPLISH NOTHING EXCEPT ENABLING RAMPANT VIOLENCE.”

The pile-on continued last Friday on a technology podcast hosted by Mr. Calacanis and other venture capitalists. On the show, David Sacks, founder and partner of Craft Ventures, said he would “bet dollars to dimes” that Mr. Lee’s killing was like a case in Los Angeles where “a young woman was basically stabbed for no reason by a psychotic homeless person.”

Mr. Musk, the billionaire head of Twitter, which is based in San Francisco, concurred “absolutely” with Mr. Sacks’s sentiments in a reply to his tweet. Mr. Musk did not respond to requests for comment.

Brooke Jenkins, the San Francisco district attorney, slammed Mr. Musk on Thursday, specifically calling his tweets on Mr. Lee’s death “reckless and irresponsible.” National crime data shows that rates of violent crime have dipped or held steady over the past several years in the city of more than 800,000 people, and that the murder rate in 2020 was low compared with that of other major American cities.

The city, however, has experienced a rise in property crimes since 2020, along with a visible growth in homeless encampments and drug use in public areas, all factors that were emphasized last year during the campaign to recall Mr. Boudin. After his removal, he was replaced by Ms. Jenkins, who had criticized her predecessor as being too lenient on criminals.

On Thursday, Mr. Calacanis, when asked if he had changed his mind about the situation after the arrest of Mr. Momeni, said by email, “When was the last time you walked a mile in San Francisco? Do you think it is safe?”

Asked again to elaborate on his position, he explained that it had not changed. “The press trying to make this into a ‘gotcha’ situation is just pathetic,” Mr. Calacanis said.

He added that he had watched “San Francisco go from the No. 1 destination for founders and senior executives to the bottom of the list. The No. 1 reason given is crime and violence.”

Mr. Sacks did not respond to a request for comment, but his spokeswoman sent a link to a podcast, which was published early Friday, in which he and Mr. Calacanis defended their earlier assessments that unsafe conditions in San Francisco were to blame for Mr. Lee’s death. On the recording, Mr. Sacks said his bet that Mr. Lee was killed by an unhoused person was “logical.”

Some tech workers and venture capitalists struck back at their narrative after the arrest, and the snap judgments made by others who implicated the city.

“The same people who purchased a recall based on their racist lies have been telling lies about how Bob died, all to further their political agenda,” Anil Dash, a tech entrepreneur, wrote, referring to the ouster of Mr. Boudin.

In an interview on Friday, Mr. Dash called himself an acquaintance of Mr. Lee who was familiar with the slain man’s zeal for San Francisco. “He didn’t want to see San Francisco demonized,” Mr. Dash said. “To contradict the man’s values and use it for political gain for things he did not agree with is the height of cynicism.”

Brett Ashton, 56, who is Black and has worked for tech companies in the Bay Area for more than 30 years, said that he was not surprised by Mr. Musk’s comments, given what the Tesla chief and Twitter owner had said in the past. But he said he felt that Mr. Calacanis had crossed over into new territory by blaming the local community.

“Their comments are very much about Black people and brown people and people that don’t look like them,” he said in an interview. “They are just pushing a narrative that tech bros are being victimized by a dystopian hellscape.”

San Francisco prosecutors said in a court document on Friday that Mr. Momeni, 38, stabbed Mr. Lee, 43, on a secluded street in San Francisco in the early hours of April 4 and then sped off in his sports car.

The two men had argued earlier in the evening over whether anything “inappropriate” had happened between Mr. Lee and Mr. Momeni’s sister, prosecutors said. A lawyer for Mr. Momeni, Paula Canny, said that “romance” was not involved.

Some in the technology industry did not try to make political statements after Mr. Lee’s death, but instead memorialized what he had done for San Francisco. Jack Dorsey, the chief executive of Block, the developer of the Square payments system, recalled in an internal email last week seen by The New York Times that Mr. Lee helped pick up trash around the company’s office off Market Street.

It was on one of those cleanups that he and Mr. Lee conceived the idea for Cash App, the company’s popular peer-to-peer mobile payments app, Mr. Dorsey wrote. Mr. Lee sent the first Cash App transaction to Mr. Dorsey in August 2013.

Oliver Lee said on Thursday that his family was still grieving, and that the politicization of his brother’s death had added to their emotional burden.

“We’re focused on healing and Bob’s legacy, and making sure people remember him for who he was,” he said. “First we lost him. And then all this crazy attention. It’s been hard.”

Shawn Hubler, Thomas Fuller and Kalley Huang contributed reporting.