The Uvalde massacre began after the 18-year-old gunman entered the school through a door that could only be locked from the outside then got inside a classroom that had a busted lock, experts testified Tuesday.

Securing doors has long been a focus of school safety drills, and the inability to do so during the May 24 attack that left 19 children and two teachers dead is raising alarms among experts and politicians.

When doors are not secure, “your first step, your first line of defense has now been eliminated,” said Ken Trump, the president of the National School Safety and Security Services.

State Sen. Paul Bettencourt said unlockable doors make lockdowns and shooter training worthless, adding that there was “zero obstacle to the shooter.”

Questions about how the shooter entered Robb Elementary and what happened at multiple doors have been a big part of the changing information about the attack.

State police initially said the gunman entered the school through an exterior door that had been propped open by a teacher.

Days later, state police retracted that statement to make it clear that the teacher closed the door. But somehow it didn’t lock.

Nearly a month after the rampage, Col. Steve McCraw, director of the Texas Department of Public Safety, further amended what his agency’s investigation shows: The teacher did close the door, but unbeknownst to her, it could be locked only from the outside.

The gunman “walked straight through,” McCraw said Tuesday in blistering testimony at a state Senate hearing in Austin.

Ronald Stephens, executive director of the National School Safety Center, said he was “astonished” that the exterior door could only be locked from the outside. He likened it to a house that could only be locked from the outside.

“Shouldn’t the security of the school be as safe as the security of your home?” he asked.

Experts did not explain during the hearing why the school’s exterior door locked from outside. Robb Elementary is an older building, constructed in 1955.

Once inside the school, the shooter then entered a classroom though a door that was designed to be locked from the outside, according to McCraw, who also said a teacher reported before the shooting that the lock was broken.

Stephens and Trump also raised alarms about the fact that the door was broken, describing it as a maintenance issue.

McCraw also disclosed Tuesday that despite the door being unlocked, there was no indication officers tried to open it during the standoff. He said police instead waited for more than an hour for a key.

Many schools designed in the 20th century featured classroom doors that locked from the outside, allowing the teacher or administrator to lock up as they left for the day, Todd Ferking explained in an email. Ferking is a design leader for DLR Group, an architecture firm that specializes in school design.

“Locking from inside the classroom may not have been a popular option out of concern that students could lock the teacher out,” he said.

The Columbine tragedy led to an evolution in school construction, he said, with most new classrooms designed to provide locking from inside via a key or thumb turn.

Today, it also is general practice that all exterior doors are locked during school hours, except during drop-off and pick-up, he said.