MILWAUKEE — Officials said they are investigating why Anthony Ferrill — a 51-year-old electrician with a wife, grandchildren and a Doberman he adored — walked into his workplace and began shooting Wednesday afternoon, leaving five dead before killing himself.

On Thursday, a chilly wind blew through the deserted Molson Coors complex with its soaring red “Miller” beer sign, its employees sent home and the work halted on the factory floor. Residents across this Midwestern city grieved and gathered at a community prayer vigil. Relatives of the victims began making plans to bury the dead.

The five victims — utility workers, machinists and electricians — came from across southern Wisconsin to work at the iconic brewery, Molson Coors chief executive Gavin Hattersley said at an afternoon news conference. They were identified as Jesus Valle Jr., 33; Gennady Levshetz, 61; Trevor Wetselaar, 33; Dana Walk, 57; and Dale Hudson, 60.

“They were husbands, they were fathers, and they were friends,” Hattersley said at the briefing. “They were part of the fabric of our company and our community, and we will miss them terribly.”

Authorities did not provide any information about the motive of the attack by Ferrill at the brewery where Miller beer has been made for over a century. While some workplace attacks have been carried out by people who had just lost their jobs, Milwaukee Police Chief Alfonso Morales said Ferrill was still an employee when the attack occurred.

The reasons for the attack are “still under investigation,” Morales said.

“Our families are hurting . . . and the city is hurting,” Milwaukee Mayor Tom Barrett said at the briefing, declining to answer a reporter’s question about a rumored motive for the attack.

Milwaukee police had spent much of Wednesday searching a small and neatly kept brown rambler on the city’s northwest side where Ferrill lived, bathing the house in lights. Neighbors said Ferrill was often seen walking his Doberman and clad in the reflective neon yellow work uniform that is standard at the brewery.

“He looked like he’s controlling traffic,” neighbor Calvin Matthew said.

The longtime neighborhood resident and his wife expressed shock to hear the familiar face was believed to be a mass shooter.

“You just really never know what people are going through,” Tequila Matthew said. “It’s just horrible.”

Steven C. Gabert, a personal injury attorney in Milwaukee, said he represented Ferrill following a 2016 car accident. A longtime electrician at Molson Coors, Ferrill had suffered injuries in a car crash after another driver failed to yield and ultimately settled the case with American Family Insurance. Ferrill returned to his job at the brewery shortly after the crash, which was not work-related.

“I got the impression he was a hard worker,” Gabert said in a phone interview, “and that it was a good job.”

In conversations with the lawyer, Ferrill had said his career at Molson Coors made him happy, paid well and allowed him to support his family — his wife, an adult son and a younger daughter — but added that working as an electrician at multiple buildings around the campus was more physically demanding than it seemed. Ferrill suffered from chronic pain that left him frustrated, Gabert said, and that may have affected his ability to work. Still, Ferrill never spoke ill of his co-workers, Gabert said. The attorney said he was shocked that his former client could have committed such a violent act.

“I never saw any anger out of him. I never saw any violence or aggression,” he said. “As a personal injury lawyer, you meet all different people, and some are mean because they’re hurting. This guy wasn’t like that at all . . . If he had been the victim, that would have made more sense to me.”A tall but soft-spoken figure with an easy smile and glasses, Ferrill “was a very nice guy, very articulate, polite and reasonable — a very pleasant person to be around,” the lawyer said.

The two men had met several dozen times while litigating the case and had also discussed another “small personal injury matter” that never went to court, which Ferrill declined to give details on. They would congratulate each other on their respective efforts to lose weight, though they had not seen each other in more than 18 months.

Residents said the Wednesday’s shooting tore a hole in the civic fabric of this lakeside industrial town of 600,000 that has frayed over the years but has experienced a renaissance of late, with craft breweries and posh new loft projects, readying for its turn in the spotlight this summer when thousands of delegates descend for the Democratic National Convention.

“I’ve got a heavy heart . . . It’s just sad in Milwaukee,” said Russell W. Stamper II, the alderman who represents the district housing the Molson Coors facility.

Stamper called the shooting “just outright devastating,” saying that it was reverberating across the city of Milwaukee.

He described Molson Coors facility as “an anchor” for the area, along with other nearby businesses, including another American icon, Harley-Davidson. The brewery complex is spread out over several blocks of west Milwaukee and contains dozens of buildings that house over 1,400 employees — many of whom had to flee the scene Wednesday night without car keys and coats.

He said that his previous conversations and information about Molson Coors have been positive, describing it as a diverse place that pays well and is active in the community. Officials have said the factory and officials will be closed for at least the remainder of the week.

“It’s hard to go back to work after a tragedy like that,” Stamper said. “People are going to need time to grieve. And really get to the bottom of it, what really happened, why did he do that?”

In a city whose early residents included beer-loving Germans who immigrated to the United States in the 1850s, the killings at the brewing campus were felt deeply. The brewery was founded as Miller Brewing in 1855 by Frederick Miller, a German brewer to royals who arrived in the United States with $9,000 in gold — a princely sum at the time — and snapped up a bankrupt brewery.

The city that now has an estimated 40 breweries takes pride in its rich beer-brewing tradition, one that inspired the name of the city’s Major League Baseball team.

“There’s beer in our veins,” said John Gurda, author of “Milwaukee: A City Built on Water.”

Russ Klisch, the owner of the city’s largest craft brewery, Lakefront Brewery, recalled that when he was growing up as a kid, getting a union job at one of the big breweries such as Miller, Pabst or Schlitz was a big deal.

“If you got yourself a brewing job, everybody said, ‘That’s fabulous. Now you’re set for life,’ ” he said.

Of those big three, the Miller operation is the only large-scale operation left.

“For everybody in Milwaukee, it’s an iconic place and part of our heart here,” Klisch said. “Miller, to me, is the reason why we’re called ‘Brew City.’ They are the ones that carried the torch to make everybody think we’re a brewing mecca.”

Molson Coors, the current parent company, announced in October it would be moving hundreds of corporate jobs to Milwaukee from Denver in a restructuring move.

While much remains unknown, both local officials and Democratic presidential candidates are already calling for changes to stop deadly mass shootings.

“We know that our country needs to do more to prevent senseless gun violence,” Rep. Gwen Moore (D), who serves Wisconsin’s 4th District, wrote late Wednesday evening. “It’s a cruel irony that tomorrow marks the anniversary of the House passing legislation to expand background checks on guns, which is languishing in the Senate.”

The rampage is the first shooting in a public space in 2020 to leave four or more people dead, according to a Washington Post database. The carnage adds Milwaukee to the list of American cities scarred by gunfire in schools, houses of worship, workplaces and other venues, a grim fraternity that in recent years has expanded to include El Paso; Dayton, Ohio; Parkland, Fla.; Las Vegas; and Orlando. Experts say that mass attacks in public spaces, including workplaces, often follow warning signs. Most shooters feel a sense of grievance or victimization, which can occur after trouble on the job, experts say.

The Ridge Community Church, which has two campuses within a 20-minute drive of the brewery, was to holding a prayer vigil Thursday evening for the shooting victims, said spokeswoman Olivia Marks.

“This one hits close to home to us,” she said, explaining that their congregation includes several people who were at the scene during the shooting or had lost loved ones. “Milwaukee feels like a big small town, and so it’s just a community that’s really heartbroken and rocked right now.”

This story has been updated with revised information on Gennady Levshetz, 61, and Dale Hudson, 60. Police originally released incorrect ages for those victims.

Berman reported from Washington. Julie Tate, Teo Armus, Katie Zezima, Hannah Knowles and Marisa Iati in Washington contributed to this report.