It was the speech of a lifetime, an impassioned pitch for Seattle to rally together to solve the spiraling crisis of homelessness.

“I hear your frustrations, and I share them,” said Seattle Mayor Ed Murray in a special TV address Tuesday night. “People are dying on our streets. We are working on a complex problem in real time.”

Murray had no idea how true his words would soon prove to be. Moments after the mayor finished his speech, he learned that a shooting in a homeless camp called “the Jungle” had just killed two people and injured at least three others. Two suspects, maybe more, remained on the loose.

Two homeless men had been fatally shot inside of a tent, police said. Three other homeless people, including two women, were injured in the shooting, which police called “very targeted.”

The deadly incident underlined the mayor’s desperate plea for state and federal assistance to combat vagrancy in Seattle. In November, after 66 homeless died during the year in King County, Murray declared a state of emergency, comparing the epidemic of deaths to a natural disaster.

But Tuesday’s shooting also ratcheted up the already intense debate over crime and homelessness in the city and over whether Murray’s administration has done enough to combat either.

News of the shooting immediately overshadowed Murray’s speech, as the mayor was criticized from all sides on social media.

As dozens of Seattle police cars cordoned off the area around the homeless camp, near King County International Airport, the mayor arrived and struck a defiant note.

“I think it would be a travesty if some people use this tragedy to try and paint all homeless people as criminals,” he said.

Asked for his immediate reaction to hearing the news of the shooting, the mayor sounded somber.

“I can’t help but wonder, did I act too late?” he said. “That’s my reaction. Maybe I should have issued the state of emergency months earlier. We have tried to do the best we can, given the circumstances we’ve been given. Obviously I’m going to ask if I did a good enough job. It’s on me in the end.”

Frustration with Murray and other city officials has mounted over the past year as many Seattleites have complained about the city’s swelling ranks of homeless people and crime rates, which have risen since 2010. In some neighborhoods, residents have taken recently to hiring private security, according to the Seattle Times.

“The blatant lawlessness has been a whole new era” this past year, Seattle resident Angie Gerrald told the newspaper. She complained of illegally parked RVs, open drug deals and piles of used needles in her neighborhood of Ballard. “There is so little response — so little they [police] can and will do about it.”

Details of the shooting were still vague as of Wednesday morning, with police saying only that they had scoured the neighborhood around the camp for a sign of at least two suspects, whom officers declined to describe because they were still interviewing witnesses.

The shooting is the worst in Seattle since 2012, when five people were killed at a local cafe, according to KIROTV.

Gunshots rang out over south Seattle just as the mayor was delivering his 7 p.m. address at a newly established homeless center in the north of the city.

“Tonight I want to speak to you, the people of Seattle, about the growing crisis of homelessness, but also about public health, public safety and the disorder that we see on our streets,” Murray said. “This is a difficult conversation that we as a city have been engaged in, not just in recent months, but for decades.”

Tuesday’s shooting seemed to prove his point. In the summer of 2009, the same wooded area was the site of two slayings in as many months. Neither crime was ever solved, KIROTV reported.

Problems at the homeless camp go back much further, though.

“You don’t want to go down there,” Nicole Brodeur wrote in the Seattle Times in 2007. “Not even in broad daylight, and certainly not alone. … Homeless encampments are a health hazard, not only for those who live in them, but for neighbors concerned with their safety, and the rats and campfires that threaten their homes.”

As the mayor suggested in his speech, the shooting site and other homeless encampments contain many types of people, from down-on-their-luck citizens to drug addicts and criminals.

“The Jungle is not a homeless camp,” community activist Craig Thompson wrote in 2012. ” The woods have historically contained camps of people. … When cleanups, sweeps or whatever you want to call them have been suspended, people living in the woods have been victimized by violent criminals. Sometimes, those criminals have been other homeless people; sometimes by those in the narcotics trade.”

After learning of the shooting, Murray acknowledged that the camp has been “unmanageable and out of control” for almost 20 years.

In many ways, the mayor’s speech seemed to anticipate the fierce debate that would be reignited by Tuesday night’s shooting. He asked Seattleites to set aside “extreme rhetoric about who homeless people are” and instead focus on how to solve the crisis.

Murray laid out the city’s struggle with homelessness in stark terms. The city’s homeless population had exploded, he said, and Seattle needed state and federal aid to keep up.

“Before the Great Recession, there were 13,000 children in the state of Washington who were homeless,” he said. “Today that number has grown to 32,000 children statewide. This year in Seattle alone, the number of homeless school-age children in our public schools has risen to 3,000.”

He called homelessness a “national tragedy” and linked it to decades of cuts to federal programs for affordable housing, substance-abuse clinics and mental-health treatment.

“We are in the midst of one of the largest heroin epidemics in our country’s history,” he said. “Addiction is on the rise in every community across the nation: urban, rural, suburban, in New Hampshire, in Kentucky, in Oklahoma and across the Pacific Northwest.”

In Seattle, he said, “we see the tents under freeways, rundown RVs in our neighborhoods, people on the sidewalks with signs that read, ‘Disabled veteran, anything helps.’ This is what income inequality looks like. This is what a disappearing middle class looks like.”

The city would spend nearly $50 million to combat homelessness this year, he added, touting new shelters and a program to provide “safe lots” for people living in their cars and RVs. Murray compared the task at hand to the challenge of stopping the HIV/AIDS epidemic in the 1980s and ’90s. “I have seen it done before,” he said optimistically.

But the magnitude of the problem remaining was brutally highlighted by Tuesday night’s shooting.

As police continued to search for the suspects on Wednesday morning, a line from near the end of the mayor’s speech seemed to capture the challenge lying ahead.

“The reality is that the people on our streets are living harsh and dreadful lives,” Murray had said, just seconds before learning of the shooting. “Ending homelessness will be as difficult as any challenge that we face as a city.”

Justin Wm. Moyer contributed to this report.