In 1998, Russell Weston Jr., a 41-year-old with a history of mental illness, charged into the U.S. Capitol building armed with a .38-caliber revolver. He killed Jacob Chestnut, a Capitol Police officer, with a point-blank shot to the head, and fatally wounded another officer, Detective John Gibson, who was assigned to then-House Majority Whip Tom Delay’s security detail. Gibson returned fire and managed to wound Weston, who was then restrained by other officers.

The incident proved a seminal moment in the history of the Capitol Police, a 2,100-person force responsible for protecting members of Congress and the millions of people who traverse the Capitol grounds each year. In the aftermath, officers were given more-powerful weapons and officials overhauled tactics. One key new focus was training for all officers on how to confront an active shooter, according to Rubard Gillus, who retired in 2011 after two decades as a Capitol Police officer.

That training was put to the test on Wednesday, when authorities say James Hodgkinson, a 66-year-old from Belleville, Illinois, opened fire on a baseball field where Republican members of Congress were practicing for an upcoming charity game. Among those wounded in the attack were House Majority Whip Steve Scalise of Louisiana, and two members of his security detail, Crystal Griner and David Bailey. According to eyewitness accounts, the two Capitol Police officers managed to keep returning fire despite being wounded.

Alexandria Police arrived at the scene a few minutes later and shot and killed Hodgkinson.

The quick response by Griner, Bailey and third member of Scalise’s security detail who was not injured in the attack, Henry Cabrera, was widely praised in the hours after the shooting.

“Had they not been there, it would have been a massacre,” Senator Rand Paul of Kentucky told MSNBC on the day of the shooting. “The only chance we had was that the shots were returned by the Capitol Hill police.”

Representative Mike Bishop, a Republican from Michigan who was also on the field as the shooting unfolded, said the Capitol Police officers saved his life.

“I know as sure as I’m standing here right now, there’s no way we would have lived through that,” he told CBS This Morning.

After Wednesday’s shooting, House Speaker Paul Ryan of Wisconsin extended his “profound gratitude” to the officers, and Minority Leader Nancy Pelosi of California remarked “how fortunate we were that they were on the scene.”

The horrific shooting renewed attention to the role the Capitol Police play in guarding federal lawmakers — but landing an assignment on the force is no easy task. Before joining, prospective officers have to complete a battery of arduous examinations designed to measure their strength and capacity to guard against shootings and other violent threats. Before being offered a position, recruits are put through written and physical tests, an hours-long psychological assessment, and an interview in front of a board of top brass.

Officers aren’t paid until basic training begins at the Federal Law Enforcement Training Center on the coast of Georgia, the same facility where prospective agents for Immigration and Customs Enforcement; the Bureau of Alcohol, Tobacco, Firearms and Explosives; and dozens of other federal law enforcement agencies train. After 12 weeks, officers are sent to the Capitol Police Training Academy, a 40,000-square-foot facility in Cheltenham, Maryland, for another 13 weeks of instruction that includes drills with mockups of the Capitol and other buildings they will be protecting.

Gillus said the training involved actors who played the roles of victims and suspects. He recalled one scenario where officers had to disarm a man who was pretending to hold employees hostage at gunpoint, and another where a fake attacker was threatening to set off a bomb in the Capitol rotunda.

Gillus said officers become expert marksmen and practice with their weapons multiple times a year in trainings that teach them to stay calm under pressure.

“The calm one usually gets things done,” he said. “That’s what we’re trained to become. You’re prepared for any situation that comes up.”

A 2013 article in the Federal Law Enforcement Training Centers Journal said the focus of active-shooter training is to teach officers how to keep the death toll to a minimum. To that end, instructors have introduced what they call single-officer response, in which officers learn how to neutralize attackers alone. “There may be no time to wait for back up,” the article warns.

Congressional leadership, including the House and Senate whips, have a dedicated, full-time security detail. Rank-and-file members receive protection outside of the Capitol if the police believe someone has made a credible threat against their safety. Local police may also guard members in their home districts.

The reality that members of Congress have little protection outside of the Capitol has led some congressmen to declare that they will take matters into their own hands. Representative Barry Loudermilk, a Republican from Georgia, has called for relaxed concealed-carry restrictions for lawmakers in Washington so they can defend themselves in the absence of police protection. Representative Chris Collins, a Republican from New York, told WKBW-TV on Wednesday that his gun “is going to be in my pocket from this day forward.”

The 1998 incident isn’t the only time Capitol Police have been called into action. At the start of the 2013 government shutdown, a 34-year-old dental hygienist drove through a White House security checkpoint, struck a Secret Service agent with her car, and led Capitol Police on a chase through the district’s streets before being mortally wounded in her car. The incident was a one-off event by a woman with mental health issues, but the department put the Capitol on lockdown as a protective measure.

Wednesday’s shooting made the officers involved household names. CBS reported that Griner and Bailey barrelled onto the field as the first shots rang out, giving the congressmen and their staffers time to run for safety, while Cabrera returned fire from behind the first-base dugout, where Senator Jeff Flake of Arizona had sought cover.

“The United States Capitol Police is dedicated to its mission to protect the U.S. Capitol, Members of Congress, staff and the visiting public,” Capitol Police Chief Matthew Verderosa said in a statement, “and today we saw how our officers’ extensive training and quick response saved lives.”