After nearly an hour, police ended the lockdown.
The shooting comes two weeks after a mentally disturbed employee terrorized the Navy Yard with a shotgun, leaving 13 people dead including the gunman.
As a warning was sounded, the House abruptly went into recess and lawmakers left the chamber floor. The Senate also suspended business.
Before the disruption, lawmakers had been trying to find common ground to end a government shutdown. The House had just finished approving legislation aimed at partly lifting the government shutdown by paying National Guard and Reserve members.
People standing outside the Supreme Court across the street from Congress were hurried into the court building by authorities.
The White House also was briefly locked down after the incident at Capitol Hill and the stretch of Pennsylvania Avenue in front of the compound was closed to pedestrians. Secret Service said the procedures were precautionary.