The Uvalde school district’s police chief has stepped down from his position on the city council just weeks after being sworn in.

It comes after allegations he erred in his response to the mass shooting at Robb Elementary School that left 19 pupils and two teachers dead.

Pete Arredondo told the Uvalde Leader-News on Friday he decided to quit for the good of the city administration.

He was elected to the District 3 council position on May 7 and sworn in — in a behind-closed-doors ceremony — on May 31, just a week after the massacre.

Using photos of doors from Robb Elementary School, Texas Department of Public Safety Director Steve McCraw gives evidence at a Texas Senate hearingUsing photos of doors from Robb Elementary School, Texas Department of Public Safety director Steve McCraw gives evidence at a Texas Senate hearing (Eric Gay/AP)

“After much consideration, I regret to inform those who voted for me that I have decided to step down as a member of the city council for District 3. The mayor, the city council, and the city staff must continue to move forward without distractions. I feel this is the best decision for Uvalde,” Mr Arredondo said.

Mr Arredondo, who has been on administrative leave from his school district position since June 22, has declined repeated requests for comment from The Associated Press.

His lawyer, George Hyde, did not immediately respond to emailed requests for comment on Saturday.

On June 21, the city council voted unanimously to deny Mr Arredondo a leave of absence from appearing at public meetings.

Relatives of the shooting victims had pleaded with city leaders to fire him.

Representatives of the Uvalde mayor, Don McLaughlin, have not responded to requests for comment on Saturday.

Steven McCraw, director of the Texas Department of Public Safety, told a state Senate hearing last month that Mr Arredondo — the on-site commander — made “terrible decisions” as the massacre unfolded on May 24, and that the police response was an “abject failure”.

A campaign sign for Pete ArredondoA campaign sign for Pete Arredondo (Jae C. Hong/AP)

Three minutes after 18-year-old Salvador Ramos entered the school, sufficient armed law enforcement were on scene to stop the gunman, Mr McCraw said in evidence.

Yet police officers armed with rifles stood and waited in a school corridor for over an hour while the gunman carried out the massacre.

The classroom door could not be locked from the inside, but there is no indication officers tried to open the door while the gunman was inside, Mr McCraw said.

Mr McCraw has said parents begged police outside the school to move in and pupils inside the classroom repeatedly pleaded with 911 operators for help while more than a dozen officers waited in a corridor.

Officers from other agencies urged Mr Arredondo to let them move in because children were in danger.

“The only thing stopping a hallway of dedicated officers from entering room 111 and 112 was the on-scene commander who decided to place the lives of officers before the lives of children,” Mr McCraw said.

Investigators search for evidence outside Robb Elementary SchoolInvestigators search for evidence outside Robb Elementary School (Jae C. Hong/AP)

Mr Arredondo has tried to defend his actions, telling the Texas Tribune that he did not consider himself the commander in charge of operations and that he assumed someone else had taken control of the law enforcement response.

He said he did not have his police and campus radios but that he used his mobile phone to call for tactical gear, a sniper and the classroom keys.

It is still not clear why it took so long for police to enter the classroom, how they communicated with each other during the attack, and what their body cameras show.

Officials have declined to release more details, citing the investigation.

Mr Arredondo, 50, grew up in Uvalde and spent much of his nearly 30-year career in law enforcement in the city.