DAYTON, Ohio — In the hours before the mass shooting, Connor and Megan Betts, brother and sister, drove together in the family’s 2007 Corolla to visit this city’s historic Oregon District, an area alive on a summer night with restaurants, bars and nightlife.

Then, police said, they separated.

It is not clear what the woman, 22, did at that point. But her brother, 24, donned a mask, body armor and ear protection. Wielding an “AR-15-like” weapon with magazines containing 100 rounds, he set out on a street rampage that, while it lasted only about 30 seconds, claimed the lives of nine people and injured 27 others.

Among the first to die was Megan Betts. A male companion was injured.

Many more might have died, officials said, but police patrolling the area saw people fleeing and quickly “neutralized” Connor Betts — he was shot to death — as he was about to enter a bar where dozens of people had run to hide. A bouncer was injured by shrapnel. At least six officers fired at Betts.

“As a mayor, this is a day that we all dread happening,” Dayton Mayor Nan Whaley said during a news conference Sunday morning.

The attack came less than a day after a man with a high-powered weapon killed 20 people in El Paso and a week after a gunman fired on the Gilroy Garlic Festival in California, killing three people and wounding 12.

Authorities in Dayton said four women and five men were killed. Of the 27 people who were injured, 15 had been discharged from the hospital by Sunday afternoon.

Exactly what precipitated the chaos is unknown.

The firearm was purchased legally, police said, and there was nothing in Betts’s background that would have raised concerns — he’d had traffic tickets for speeding and failure to yield.

Betts had been studying psychology at a community college and working at a Chipotle restaurant. In an online profile, Betts reportedly described himself as “Good under pressure. Fast learner. Eager to overachieve.” But Betts also had been troubled in high school, at one point drawing up a “hit list,” and such incidents, along with his relationship with his sister, will be points of interest for the investigators.

Dayton Police Chief Richard Biehl said authorities are still trying to answer “the question that everyone wants to know: Why?”

The shooting shattered a typical summer weekend night’s revelry in Dayton’s Oregon District, an area east of downtown that was busy with the nightlife of bars and restaurants.

Pulling up to the area that night with the Betts siblings was a male companion, police said, and the trio parked a few blocks from where the shooting would begin.

At some point, Connor Betts left the group.

“What they did during that time they weren’t together is a question mark,” Biehl said.

Before the first shots rang out, it was a night of celebration for the interns from the Maple Tree Health Alliance, a cancer-treatment center.

One of them was Tyler Erwin, 27, who was standing in line for the Ned Peppers bar with his girlfriend, Mary Pelphrey, and three fellow interns when they heard the shots as Betts fired first in an alley and then many more times on Fifth Street.

Video recordings of this time show people running past parked cars as shot after shot rang out.

Erwin grabbed Pelphrey and dived toward a doorway next to the bar. For a minute, all they heard was more gunshots and screaming, Erwin remembered.

After what felt like hours, the couple emerged. “There was just bodies, blood everywhere,” he said.

One of their friends, Hannah Martin, had been shot in the leg, Erwin said. Another, Kelsey Colaric, had been shot in the abdomen. A third, Nick Cumer, was on the ground and rolled onto his side. The 25-year-old has been confirmed as one of the people slain in the shooting.

Cumer was a graduate student in the master of cancer care program at St. Francis University in Pennsylvania and spent the summer living in Columbus and commuting an hour each morning to the Alliance’s treatment center.

“Nick was an extraordinary human being. He was intelligent; he was extremely caring and kind. He loved his patients, and he always went above and beyond for them,” Erwin said.

Belinda Brown, a 46-year-old elementary school teacher in Dayton, told The Washington Post that her niece was sitting outside a restaurant when the shooter, clad in black and wearing a mask, pulled out a large gun and “just opened fire.” Her niece jumped up with her friends, ran inside and hid behind the bar, where she huddled with employees, said Brown, who heard the account later.

The niece, her friends and the employees were able to exit through the rear of the bar, she added.

Brown’s nephew, meanwhile, was at a club next door to the restaurant. As soon as he heard the loud pops, he began recording with his phone — and running.

“Nothing ever happens in the Oregon District. It’s a very quiet, upscale neighborhood in Dayton, and everybody hangs out there,” Brown said.

Megan Betts was not the first person to be shot, according to police. But she and the male companion were among the earliest victims, and it appeared they were shot when Connor Betts emerged onto Fifth Street.

Police said officers quickly ended the attack by shooting Betts, who began firing about 1 a.m.

Surveillance footage from outside Ned Peppers captured the moment Betts was struck multiple times by police fire as he tried to enter the establishment. Police said they stopped him in 30 seconds.

“Had this individual made it through the doorway of Ned Peppers with that level of weaponry, there would have been catastrophic injury and loss of life,” Biehl said. “So stopping him before he could get inside there — where you saw people were running in there for protection — was essential to minimizing, to the degree we could, casualties and deaths from this incident.”

People were wounded in the stomach and extremities, and injuries such as a cut foot were suffered in the chaos after the shooting, officials said. One of the victims was in critical condition Sunday afternoon.

Because the investigation is in its early stages, Biehl said, “any suggestion of motive would be irresponsible.”

Midway through Betts’s freshman year at Bellbrook High, the school became aware that he had a list of people, including classmates, whom he wanted to take “revenge” on, said Samantha Thomas, 25, who attended Bellbrook at the same time as Betts.

“It was a list of girls and all of these really pretty vile things that he was going to do to them,” Thomas said. “All the girls were really freaked out. He got kicked out of school for it.”

David Partridge, 26, who also attended Bellbrook with Betts, said the list included a member of his family. Partridge said a friend of his called the Sugarcreek Township police department to alert them to the list, and that officers later pulled Betts off a bus as he was headed to school one morning.

“I watched as they apprehended him,” Partridge said.

Bellbrook High officials could not immediately be reached for comment. Dayton police declined to comment about the list.

Also unknown is the nature of the Betts siblings’ relationship. Megan Betts had spent the past few months as a tour guide helping visitors explore the wilds of Missoula County, Mont., said her former supervisor at the Smokejumpers Visitor Center.

She scored the internship — which ran from about the middle of May to July — through a program run by the Student Conservation Association, according to Daniel Cottrell, the manager at the visitor center.

He said that she was a “very positive person.” While she worked at the visitor center, she earned a reputation as a competent employee well liked by her peers, according to Cottrell. She also loved exploring new places — especially Montana and its culture, he said.

“We really enjoyed the time that she spent working here for us. She was full of life and really passionate,” Cottrell said in an interview with The Post. “She was a very caring individual.” Cottrell said that he never discussed Connor Betts with her but that she seemed close with her family.

When Megan Betts left the job in Montana, her mother drove to pick her up, and Cottrell noticed that the two seemed to have a good relationship.

“I’m just sad,” Cottrell said of the shooting. “I am just frustrated these things keep happening in this country.”

The Montgomery County Coroner’s Office identified the nine victims as Megan K. Betts, Monica E. Brickhouse, Nicholas P. Cumer, Derrick R. Fudge, Thomas J. McNichols, Lois L. Oglesby, Saeed Saleh, Logan M. Turner and Beatrice N. Warren-Curtis. A vigil for the victims was held on Sunday.

Hours after the shooting, the scene was cordoned off with police tape, and the area was largely deserted. But as daybreak came over the city, people filed into Dayton’s convention center seeking information about their loved ones at a station set up by the city.

Joe Oglesby, whose said his niece Lois was killed in the attack, said he felt “numb.” Oglesby said the 29-year-old had just had a baby last month and also had an older child.

“She was a nurse’s aide and a very devoted mother,” Oglesby said.

Julie Tate, Jennifer Jenkins and Morgan Krakow contributed to this report.