A 25-year-old man shot and killed five colleagues on Monday at the downtown bank in Louisville, Ky., where he worked, the police said. Eight others were wounded, two of them critically. The gunman, who used a rifle and livestreamed the attack, was killed by the police after exchanging fire with them.

The shooter was identified by the police as Connor Sturgeon. He was a “syndications associate and portfolio banker” at Old National Bank, according to his LinkedIn page. The police did not give a motive.

Several national political figures, including President Biden, issued statements on Monday deploring the violence and urging action on gun legislation. Gov. Andy Beshear of Kentucky, a Democrat, said that the day ought to be focused on “friends and loved ones that are no longer with us.”

The police received reports of shots fired at Old National Bank at 8:38 a.m. on Monday, said Jacquelyn Gwinn-Villaroel, interim chief of the Louisville Metro Police Department. “Officers were on the scene within three minutes,” she said. “The suspect shot at officers, we then returned fire and stopped that threat.”

Troy Haste, an account executive with Old National, was in a conference room on Monday morning when the gunfire started, he told a local ABC affiliate. “We heard a click, and the lady next to me turned around and said, ‘What the hell?’‌” Mr. Haste said. “And he just started shooting‌‌. He had a long assault rifle, and the shots just started firing,” he said of the gunman.

At least two officers were shot during the exchange before the gunman was killed, officials said.

Officials and Louisville residents praised the quick response of the Louisville police, who faced serious criticism after the botched raid that killed Breonna Taylor in 2020. Just last month, the Justice Department released a 90-page report condemning the department over what it identified as a wide range of abuses and misconduct.

The police identified four of the victims as employees of Old National Bank: Joshua Barrick, 40; Thomas Elliott, 63; Juliana Farmer, 45; and James Tutt, 64. The fifth victim, Deanna Eckert, 57, also worked there, according to a LinkedIn page; she initially survived the shooting but died on Monday night, according to the police.

Of the eight wounded, two were in critical condition as of Monday, three remained at the University of Louisville Hospital with non-life-threatening injuries and three had been released, the police said.

Among the critically wounded was Nickolas Wilt, 26, who graduated from the police academy on March 31. Officer Wilt required brain surgery.

Mr. Elliott was a vice president of the bank, according to his LinkedIn profile, a well-known Democratic fund-raiser and a close friend of Governor Beshear.

“Tommy Elliott helped me build my law career, helped me become governor, gave me advice on being a good dad,” Mr. Beshear said at a news conference. “He’s one of the people I talk to most in the world, and very rarely were we talking about my job. He was an incredible friend.”

Mr. Beshear ordered flags throughout the state to fly at half-staff until Friday evening to honor the victims.

Mr. Sturgeon was a “syndications associate and portfolio banker” at Old National, a regional bank. He had worked there full time for nearly two years after interning there over previous summers.

Chief Gwinn-Villaroel said she was not aware of any prior engagement that the gunman might have had with the police. She did not give any further details about his livestreaming of the mass shooting, other than to say that it was “tragic to know that incident was out there being captured.”

The branch of Old National Bank where the shooting happened shares a block with the Louisville Ballet and is across the street from Louisville Slugger Field, a stadium where the minor-league Louisville Bats play. The surrounding downtown area, not far from the Ohio River, is filled with condos and office towers.

Governor Beshear had run his 2015 campaign for state attorney general from the bank building, he said, so he knew “virtually everyone” inside. “That’s my bank,” he said.

Reporting was contributed by Campbell Robertson, Amanda Holpuch, Johnny Diaz and Jesus Jiménez and Kevin Williams.