At least nine people were killed and 27 people injured early Sunday when a gunman wearing body armor and carrying ammunition magazines opened fire at a crowded bar in Dayton, Ohio, officials said.

Nearly a dozen terrified patrons sought cover in a bathroom, not sure if people desperately pushing on the door to get in were other people seeking safety or the gunman.

The shooter has been identified by authorities as Connor Betts, a 24-year-old white male who lived in Dayton. He is believed to have acted alone. Betts was killed by responding officers within a minute of the first shots being fired, police said.

From top left, clockwise: Logan M. Turner, Thomas J. McNichols, Derrick R. Fudge, Nicholas P. Cumer, and Megan K. Betts.

One of the victims has been identified by authorities as Betts' sister, 22-year-old Megan Betts.

The other victims were Lois Oglesby, 27; Saeed Saleh, 38; Derrick Fudge, 57; Logan Turner, 30; Nicholas Cumer, 25; Thomas McNichols, 25; Beatrice Warren-Curtis, 36; and Monica Brickhouse, 39.

The incident came about 13 hours after an attack in a Walmart and near a mall in El Paso, Texas, left 20 people dead and 26 injured.

“This is a day that we all dread happening,” Mayor Nan Whaley of Dayton said at a press conference on Sunday morning.

“What's very sad is I have gotten messages from cities across the country — so many of us have gone through it,” she said.

The shooting took place at about 1 a.m. ET outside Ned Peppers Bar, in the heart of Dayton's historic Oregon District.

Taylor Mayberry, who said she was inside the bar, told NBC News she hid in the bathroom as “tons of gunshots” were going off.

Connor Betts was identified as the suspect in a shooting in Dayton, Ohio.

“I just heard a few gunshots and then saw everyone jumping to the ground,” she said. “I've never experienced anything like that, so I dove to the ground and started running to the bathroom. I saw people trying to move toward the exit.”

She said she was one of the last people to be let into the bathroom, where 10 other people were taking shelter.

“We were holding the door shut and waiting until the gunshots stopped,” Mayberry said. “People were banging on the doors throughout. We weren’t sure if they were … you know … we weren’t sure if it was people getting in to shoot us or to get safe.”

Ned Peppers said in a post on Instagram that all their staff members were safe.

Anthony Reynolds told NBC's "Today" show Sunday morning that he was exiting the bar at 1:05 a.m. when the gunfire broke out. Reynolds said he knew the exact time because he was looking at his phone while he was walking past the line of people waiting to get into the club.

"Once we got to the end of the line, which is near the corner, you heard one gunshot," Reynolds said. "You heard 'boom,' so we looking around, we didn't know what it was...and then you hear a second 'boom' and then after that it was complete rapid fire for like one minute."

Everyone was out to have a good time and the shooting was completely unexpected, Reynolds said. He described the shooter as a white male in all black clothing with a covering obscuring the lower half of his face.

Reynolds told the "Today" show that people began to run west after the shots rang out and that he lost track of a friend who was with him.

"So when I turned around, I'm looking for him, I see he was stunned," Reynolds said. "And that's when I could see the people in the line at Ned Peppers, you could see the bodies actually start to fall."

Dayton police Lt. Col. Matt Carper told reporters several officers happened to be near the bar at the time of the shooting, which allowed them to confront the shooter in less than a minute after the first shots were fired.

"For that, we are very fortunate,” Carper said.

Whaley said thousands of people were potentially out in the district enjoying the summer night when the shots rang out, and if police officers hadn’t react as quickly as they did, the death toll could have been much higher.

Ned Peppers Bar said it was "shaken and confused" in a statement on the bar's website Sunday.

"We have police regularly staffed next to our business who engaged the shooter and neutralized the threat," the statement said. "Dayton Police could not have done a better job responding to this senseless act of violence. We cannot commend them high enough."

The bar said it was holding clothing items left at the scene but was unsure when it would reopen.

“We certainly are not in the shooter’s head, but he was wearing body armor and had extra magazines,” Whaley said, adding that the suspect was carrying a .223-caliber rifle.

No police officers were injured.

Whaley said there were life-threatening injuries among the 26 wounded victims, who have been received by multiple hospitals across the city.

President Donald Trump said that the FBI, local and state law enforcement were working together in El Paso and Dayton.

"Information is rapidly being accumulated in Dayton," Trump tweeted.

"Law enforcement was very rapid in both instances," he added.

Sen. Rob Portman, R-Ohio, said that the "senseless acts of violence must stop" in a statement early Sunday. "While we are still learning more about the details of this tragedy in Montgomery County, we are praying for the victims and their families and thank the officers who responded so quickly and bravely," Portman said.

Ohio Gov. Mike DeWine ordered flags in the state at half-staff in honor of the shooting victims.

"Fran and I are absolutely heartbroken over the horrible attack that occurred this morning in Dayton," DeWine said in a statement. "We join those across Ohio and this country in offering our prayers to victims and their families."