"I want to commend Special Agents Crystal Griner, David Bailey and Henry Cabrera for their heroic and appropriate response in protecting the Members and others today during their practice for the Congressional baseball game," Capitol Police Chief Matthew Verderosa said in a statement.
"Today we saw how our officers' extensive training and quick response saved lives," he added.
Two officers were injured while responding to the shooting. Griner was shot in the ankle and Bailey suffered a minor injury when they responded to the attack, officials said. They are both now good condition.
House Majority Whip Steve Scalise is in critical condition after the shooter, James Hodgkinson of Illinois, shot him in the hip. Griner, Scalise and two other people were injured with gunshot wounds. The colleagues were gathered at a field in Alexandria, Va., for a practice for their annual charity baseball game, which will still be held Thursday at Nationals Park in Washington, D.C.
The shooter died in a hospital after exchanging fire with police.
A number of politicians have voiced praise for the police officers, saying many more people would have been injured without their quick action. A statement from Scalise's office after the shooting said he "is grateful for the brave actions of U.S. Capitol Police, first responders and colleagues."
President Donald Trump called the officers "very courageous."
"Our brave Capitol Police perform a challenging job with incredible skill, and their sacrifice makes democracy possible," Trump said on Wednesday.
House Speaker Paul Ryan also thanked them during a speech on the House floor just hours after the shooting.
"Without these two heroes, Agent Bailey and Agent Griner, many lives would have been lost," Ryan said.
Kentucky Sen. Rand Paul, one of the GOP members of Congress who witnessed the shooting at the baseball practice, also praised the rapid response from the Capitol Police during an interview with CNN.
"Our lives were saved by the Capitol Police," Paul said. "Had they not been there, I think it would've been a massacre."
Later on Wednesday, Arizona Sen. Jeff Flake, who was at the practice as well, said he met with Griner and Bailey and "thanked them for saving my life."