The three boys lived in the shadow of tremendous wealth, but knew only hardship.

At night, they slept in a tent with their mother near Safeco Field, Seattle’s $735 million baseball stadium. By day, they waded ever deeper into the glittering city’s murky underworld of drugs and violence.

On a drizzly evening last month, the brothers should have been playing sports or doing homework. Instead, they allegedly set out to collect a drug debt, police say. It was their mother’s birthday, and someone owed her $500.

James Taafulisia, 17,allegedly grabbed a gun. So, too, did 16-year-old Jerome. The youngest brother, just 13, tagged along, according to police.

They found the man they were looking for in another homeless camp commonly called “The Jungle.”

Then the boys allegedly opened fire.

The Jan. 26 shooting left two dead and three injured. It also set Seattle on edge as police scoured the city for signs of the suspects. The trio were caught six days later after authorities secretly recorded them allegedly admitting to — even laughing about — the crime, according to police.

On Thursday, prosecutors said they had charged the three teens with murder and assault. The two older boys will be tried as adults. If convicted, they could face more than a century in prison. The 13-year-old, who has not been publicly named, will be tried in juvenile court.

Although authorities say the fatal shooting has been solved, the city’s problems have clearly not. The bloody episode has highlighted chronic problems plaguing Seattle, a tech hub region — home to Microsoft and Amazon — with one of the highest per capita gross metropolitan products in the country. Drugs, crime and homelessness literally lie underneath the bustling metropolis: The boys’ tent lay underneath a highway overpass, as does The Jungle. And all three of the teens were supposed to be in state protective custody when the shooting took place.

For many, the shooting, which occurred just as Seattle Mayor Ed Murray delivered an impassioned speech on homelessness, has exposed the city’s most glaring failures.

“The lawlessness of The Jungle created the environment for this mass shooting,” King County Prosecuting Attorney Dan Satterberg said during a Thursday press conference, according to Fox 13.

The fatal shooting could scarcely have involved more of the city’s thorniest problems had it been scripted for “The Killing,” the popular crime television show set in Seattle.

Homelessness has exploded in the city and surrounding suburbs recently. The number of people living on King County streets has swollen by 19 percent in the past year to more than 4,500, the Seattle Times reported.

In his televised speech, Murray pointed to child homeless as a particularly vexing problem.

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

As he spoke, three of those homeless kids were allegedly terrorizing The Jungle.

The Taafulisia boys moved with their mother from California to the Seattle in 2002, according to the Times. Their father, however, has a criminal record in the region dating back to the mid-1990s. Police have said he is a gang member and drug dealer, and he is currently serving a 4 ¼-year prison term, the newspaper reported, citing court records and Washington’s Department of Corrections.

Their mother also has a criminal history including identity theft and shoplifting from a Goodwill store, according to the Associated Press. She completed drug court in 2008 after an arrest four years earlier for selling crack cocaine, the Times reported. In court records reviewed by the newspaper, she accused the boys’ father of being violent and threatening to kill her, as well as owing her $75,000 in unpaid child support.

She, too, lost her rights to the children, the Times reported, but her boys apparently fled foster homes to live with her in the tent near Safeco as well as motels and campsites.

“They were wards of the state, but they had run from every placement DSHS had arranged for them,” Satterberg said at the press conference, referring to Washington’s Department of Social and Health Services.

According to police, the boys were already being investigated in connection with previous robberies and another fatal shooting in October when they set off to collect their mother’s debt.

Satterberg said investigators “don’t have solid evidence” that the debt is what drove the shooting, however.

On their mother’s 37th birthday, the older boys allegedly told their mother that they were planning to do a “lick,” or robbery, on a drug dealer known as Phats, but the woman didn’t think her sons were serious, according to charging documents reviewed by the Times. They knew their way around The Jungle because they had lived there for a short time last year.

They boys had no trouble navigating their way inside the infamously lawless encampment, which Satterberg said “lives up to its name.” The teens had already learned that they could do what they wanted — with a gun, he said.

When they found the tent belonging to Phat “Phats” Nguyen, the adult didn’t seem to suspect them, according to a witness who spoke to the Times on condition of anonymity.

“Fats told them to come around the front, and they just started shooting like crazy,” he told the newspaper, adding that the attackers wore “masks and leather.”

One of the attackers then pointed his gun at him, the witness said.

“You got a [expletive] problem?” the gunman asked.

“No, I’m just an old man sitting by the fire and trying to get warm,” the witness answered.

He was spared, but five others at The Jungle were not. Nguyen and two others were injured in the shooting. Jeannine L. Zapata, 45, and James Quoc Tran, 33, died of multiple gunshot wounds.

Although the gunmen escaped with their loot — between $200 and $300 cash and about $100 worth of black-tar heroin — witnesses quickly identified the Taafulisia brothers, according to police. Authorities then used informants to secretly record conversations with the boys, in which they acknowledged the shooting, according to the Times. An informant even bought one of the weapons allegedly used in the crime from the 13-year-old.

Seattle Police swooped on the brothers six days after the shooting, arresting all three on Monday at a Seattle homeless camp. Prosecutors are still investigating whether to charge the mother, according to the AP.

They are also unsure if the 13-year-old was ever armed. When questioned by police, he said he didn’t want to get his brothers in trouble, according to the Times.

The boy “was asked if he could go back in time what would he do differently,” a detective wrote, “and he stated he would never have gone up the hill that night.”

The shooting and the boys’ arrests are sure to factor into Seattle’s ongoing debate about homelessness, crime and drug treatment. If there is any upside to the tragedy, it is that the killings have given extra urgency to solving the city’s longstanding problems.

“It’s time to envision a Seattle without The Jungle,” Satterberg said during the press conference, adding that the camp was “highly unsanitary” and “worse than Third World conditions.”

“Hundreds of thousands of people drive by The Jungle every day on I-5,” he added, according to the AP. “And these citizens are unaware of the struggles that take place there among marginalized people who are homeless, mentally ill, drug addicted and/or criminally oriented.”