WASHINGTON — As several thousand demonstrators rallied around them, eight members of the House of Representatives were arrested on Tuesday outside the Capitol in a protest to push Congress to pass broad immigration legislation that includes a path to citizenship for immigrants in the country illegally.

The protests came as most attention in Congress was focused on the standoff over the partial government shutdown and the partisan disputes over health care and fiscal policy, pushing immigration to the side.

The lawmakers, all Democrats, were detained by the Capitol Police after they stood silently in a line in the middle of a street that borders the Capitol lawn, blocking traffic. As the police handcuffed them behind their backs and led them away, a crowd pressed in, chanting, “Let them go!”

The representatives arrested were Joseph Crowley and Charles B. Rangel of New York, Keith Ellison of Minnesota, Al Green of Texas, Luis V. Gutierrez and Jan Schakowsky of Illinois, Raul M. Grijalva of Arizona and John Lewis of Georgia. More than 150 other protesters, many from labor unions and immigrant organizations, were also arrested after they sat down and linked arms in the same street.