Two children died in gun violence near St. Louis on Thursday, bringing the total number of youths fatally shot this year in and near the Missouri city to nearly two dozen.

A 3-year-old boy in St. Louis County is thought to have found an unsecured gun and shot himself shortly before noon, officials said. Despite the efforts of police officers who rushed him to the hospital while attempting life-saving measures, he died, the St. Louis County Police Department said in a statement.

Hours later, a 13-year-old boy, identified by police Friday as Clifford Swan III, was fatally shot outside a north St. Louis County apartment building. An 18-year-old male suspect, Jabari Lowery, was taken into custody at about 6 p.m. Thursday in connection with the teen's shooting, which "does not appear to be a random act," St. Louis County police Sgt. Ben Granda said in a statement.

The two deaths bring the number of children fatally shot in the St. Louis area to at least 23 so far this year, according to the station.

"This is heartbreaking," St. Louis County Police Chief Jon Belmar told reporters after the 3-year-old was shot.

"It is certainly beyond the pale and heartbreaking when we lose a child anywhere in the communities we live in," he said.

The child involved in that incident was identified by police Thursday night as Rodney March III.

The St. Louis County Police Department was called about a shooting at 11:35 a.m., and right after that call, a woman driving erratically flagged down two patrol officers who discovered the boy with a gunshot wound in that vehicle.

Belmar said there was no time to wait for an ambulance, and that police drove the boy to a hospital; one officer drove while the other performed life-saving measures.

Investigators believe the boy was home with his mother and father when he got an unsecured firearm in a bedroom and accidentally discharged it.

The death is being investigated as accidental, but officials are asking anyone with information to contact police.

Then, Thursday evening, officers were called to north St. Louis County around 6 p.m. and found Clifford, the 13-year-old, with a gunshot wound. He was transported to a hospital and pronounced dead shortly after arrival, police said.

The boy had been walking through the apartment complex with two people when the shooting occurred, Granda said.

Lowery, the suspect in Clifford's death, was charged with one count of murder in the first degree and one count of armed criminal action in the teen's death and is being held on a $500,000 bond, Granda said. A second suspect, Montez Eskew, 17, was charged with a count of assault in the third degree and resisting and interfering with an arrest for a felony and is being held on a $50,000 bond. Eskew resisted arrest by kicking police, injuring the officers, Granda added.

Granda added that some of the same police officials who responded to the scene of Thursday morning’s shooting were also at the scene Thursday evening.

"These types of things wear on the community, and they're a very heavy burden to the officers that are here, doing the best they can," Granda said.