The US Capitol Police officers who disrupted today's shooting at a congressional baseball practice are being lauded as heroes for confronting the gunman even as two of them were injured in the barrage of gunfire.

Their quick response in protecting lawmakers is exactly what the force is tasked to do.

"The Mission of the USCP is to protect the Congress - its Members, employees, visitors and facilities - so it can fulfill its constitutional and legislative responsibilities in a safe, secure and open environment," the police department says on its website.

Three Capitol Police officers were at the Alexandria ballpark during the shooting: Crystal Griner, David Bailey and Henry Cabrera. All were special agents and were part of House Majority Whip Steve Scalise's security detail.

Advertisement

After an Illinois man, James Hodgkinson, began to spray the field with bullets, at least two of the officers returned fire.

Hodgkinson died after the shootout. Scalise was hospitalised in critical condition. Griner was shot in the ankle, and Bailey was struck by shrapnel.

A Hill staffer and a lobbyist also were wounded.

"Many lives would have been lost if not for the heroic actions of the two Capitol Police officers who took down the gunman despite sustaining gunshot wounds during a very, very brutal assault," President Donald Trump said.

The history of the force dates to the early 1800s, when a lone officer, John Golding, was hired to keep watch over the Capitol after Congress moved from Philadelphia to Washington, according to a history of the department.

Congress officially approved the creation of a police force to protect the Capitol in 1828 after a series of security concerns emerged the previous year.

The new force was small: four officers who worked 15-hour shifts when Congress was in session. It grew and expanded over the years. The September 11, 2001, attacks on the Pentagon and the World Trade Center spurred a huge leap, from about 800 officers to more than 1700.

Today, more than 2100 officers and civilians work for the department, responding to issues such as suspicious packages, political protests and potential incidents of terrorism.

Advertisement

The force is also in charge of protecting the estimated three million to five million people from around the world who visit the Capitol grounds each year.

In 2013, the Capitol Police and Secret Service members fatally shot 34-year-old Miriam Carey on Capitol Hill after she led them on a car chase from the White House with her 13-month-old daughter in the back seat - a shooting that remains controversial.

In 2015, the Capitol Police arrested a man who landed a gyrocopter on the Capitol's West Lawn in a political protest.

And in recent months in separate incidents, officers fired on a 20-year-old woman after she fled a traffic stop outside the Capitol grounds and arrested pro-marijuana activists who were handing out free joints near the Capitol.

Officers also are charged with providing protection to House and Senate leaders outside the Capitol grounds.

Without the Capitol Police officers there as part of Scalise's detail today, other lawmakers said, the shooting that disrupted the GOP baseball team's practice could have been much worse.

"The only chance we had was that shots were returned by the Capitol Police," Senator Rand Paul, who was in a batting cage when he heard gunfire, said in an interview on Fox News.

Without the officers present, Paul said, the shooting would have been a "massacre".

Since the force's founding, four officers have died in the line of duty.