Freddie Perez / Philadelphia Police Department

EMBED >More News Videos Vigil held after toddler shot dead in Philadelphia. Annie McCormick has more on Action News at 11 p.m. on October 21, 2019.

PHILADELPHIA (WPVI) -- A second suspect is in police custody after sources told Action News he confessed to being the alleged gunman in the shooting death of a toddler in Philadelphia over the weekend.Tayvon Thomas was taken into custody Wednesday on unrelated charges.Police believe Thomas pulled the trigger in the homicide of 2-year-old Nikolette Rivera.On Tuesday night, police arrested another man, Freddie Perez of Chester, Delaware County, who is also charged in the fatal shooting.Perez was charged with the murder, nine counts of attempted murder, and two counts of conspiracy to commit murder.Authorities tell Action News Perez was taken into custody from his home on the 2000 block of Edgmont Avenue.Philadelphia police served a warrant at his home. Sources say bags of evidence were taken from the home, but it's not clear exactly what was found.Gunfire rang out around 3:30 p.m. Sunday inside a home along the 3300 block of North Water Street in North Philadelphia.According to Philadelphia police, the shooter opened fire with an assault rifle on the residence from outside, hitting Rivera in the back of the head. The child died in her mother's arms at the scene.Nikolette's 24-year-old mother was also shot once in the right side of the head and once in the back. She is expected to survive.Police say a 33-year-old man, a contractor who was cleaning carpets inside the home, was also shot in the stomach. He is listed in critical but stable condition at this time.Police believe Perez and Thomas were involved in a drug dispute with Nikolette's father, and when they saw the man cleaning carpets inside the home, they confused him for her dad. Thomas opened fire, hitting Nikolette, her mother, and the man cleaning the carpet."I want to thank the Philadelphia Police Department for working around the clock to bring those responsible for this terrible violence to justice. Their diligence and swift work ensured Freddie Perez was brought into custody within days, and that we now have additional evidence to start to bring closure to this investigation," Philadelphia District Attorney Krasner said.Police obtained surveillance video that helped them track down Perez. Coulter said tips helped.A sign hanging outside the home of the victim's family, in front of pink and white memorial, reads, "Thank you for speaking up.""Let me emphasize, the tips we got from people in the community are also instrumental in solving this case. We've had people giving stuff early on, giving nicknames, giving information, and it restores my faith in saying everyone is outraged when a child is murdered," Acting Police Commissioner Christine Coulter said."Maybe people can sleep knowing justice is done for at least one child," said neighbor TT Rivera. "All these babies is up here dying, left and right, from the stupidity of the people having guns and don't know what to do with them."Less than 24 hours before the shooting on North Water Street, an 11-month-old boy was also shot inside a vehicle On Thursday, police told Action News that a man was taken into custody in connection with that shooting , but he has not been formally charged.A $30,000 reward was being offered for an arrest in the shootings.