UVALDE, Texas (AP) — Frustrated onlookers urged police officers to charge into the Texas elementary school where a gunman’s rampage killed 19 children and two teachers, witnesses said Wednesday, as investigators worked to track the massacre that lasted upwards of 40 minutes and ended when the 18-year-old shooter was killed by a Border Patrol team.

“Go in there! Go in there!” nearby women shouted at the officers soon after the attack began, said Juan Carranza, 24, who saw the scene from outside his house, across the street from Robb Elementary School in the close-knit town of Uvalde. Carranza said the officers did not go in.

Javier Cazares, whose fourth-grade daughter, Jacklyn Cazares, was killed in the attack, said he raced to the school when he heard about the shooting, arriving while police were still massed outside the building.

Upset that police were not moving in, he raised the idea of charging into the school with several other bystanders.

“Let’s just rush in because the cops aren’t doing anything like they are supposed to,” he said. “More could have been done.”

“They were unprepared,” he added.

Minutes earlier, Carranza had watched as Salvador Ramos crashed his truck into a ditch outside the school, grabbed his AR-15-style semi-automatic rifle and shot at two people outside a nearby funeral home who ran away uninjured.

Officials say he “encountered” a school district security officer outside the school, though there were conflicting reports from authorities on whether the men exchanged gunfire. After running inside, he fired on two arriving Uvalde police officers who were outside the building, said Texas Department of Public Safety spokesperson Travis Considine. The police officers were injured.

After entering the school, Ramos charged into one classroom and began to kill.