Members of the Everett Police Department confer at Walden Apartments, the scene of a shooting, in Everett on Oct. 4. (Kevin Clark / The Herald)

The boy, 13, allegedly got a gun from a 12-year-old and killed a 14-year-old over a disagreement.

EVERETT — A 13-year-old boy was behind bars Thursday in connection with a gang-related shooting that killed another boy in south Everett.

The shooting happened Wednesday outside an apartment building on 12th Avenue West. Earlier in the day, the suspect confronted a 14-year-old at a south Everett area school, according to a probable cause affidavit. He allegedly didn’t like the boy’s blue shoes. The suspect flashed a gun, and walked away, according to court records.

About an hour later, the 14-year-old was at Walden Pond Apartments with a friend. They were walking along a path behind the apartment building when they ran into the suspect.

The suspect told detectives the two teens were challenging him about his gang affiliation, according to a probable cause affidavit. He reportedly pulled out a gun and fired one shot.

Paramedics took the injured boy to a local hospital where he died that night. He was a freshman at Mariner High School, according to the Mukilteo School District.

In a letter home to parents, the district identified the victim as David Sandoval-Hilarios. “David enjoyed strong friendships with his fellow students and equally strong bonds with staff,” Mariner Principal Nate DuChesne wrote.

“We extend our support and sympathy to David’s family,” he added.

The suspect was gone before officers arrived. A passerby spotted him hours later near a bus stop along W. Casino Road, Everett police officer Aaron Snell said. He had changed his clothes. The suspect reportedly led detectives to where he had hidden the 9mm Taurus handgun, which he said he had borrowed from a 12-year-old friend.

The boy was arrested late Wednesday for investigation of second-degree murder. A juvenile court judge Thursday found probable cause for his arrest and set bail at $100,000. Prosecutors have until Monday to file charges.

The judge was told that the boy had run away from his older brother’s home about two weeks ago. His grandmother, his guardian, had asked the man to care for the boy. The teen ran from the home and had been on the streets until his arrest.

The boy might have some cognitive issues, Superior Court Judge Marybeth Dingledy was told Thursday. He has been in a special-needs program at school.

Detectives will continue to investigate how the suspect obtained a firearm, Snell said.

Wednesday’s killing adds to a growing list of shootings in the past year. There have been more than 35 in the city since December. Most of those have been attributed to gangs warring in south Everett, inside and outside city limits. There have been at least 56 gang-related shootings countywide since early 2015, according to detectives.

In Everett last month, a 17-year-old was shot while in car on W. Casino Road. The next day a 19-year-old was accidentally shot in the back by a 16-year-old outside Providence Regional Medical Center’s Colby campus. The teens had been at the hospital to visit the boy who’d been shot the previous day.

The color of clothes teens wear has led to bloodshed in the past in south Everett.

In an apparent case of mistaken gang affiliation, two Everett teenagers — a brother and sister —were shot in 2015 based on the color of the clothes the boy was wearing. Both survived.

The suspect, then 17, admitted to detectives he was dressed in red to represent his gang affiliation and confronted the boy about wearing blue shorts — the color favored by a rival gang.

Neither the boy and his sister nor another girl who accompanied them had any association with gangs, nor did they know the suspect prior to the shooting.

DuChesne at Mariner High told students about David’s death at the beginning of the school day Thursday. In the letter home, he included a list of staff counselors and their email addresses. “Our counselors will be available to help our school community in the days to come to help us deal with this sad loss.”

Diana Hefley: 425-339-3463; hefley@heraldnet.com.