A Texas state representative, referring to protesters at the State Capitol on Monday, said he reported “several illegal immigrants” to federal immigration authorities and then threatened to shoot a fellow lawmaker who objected.

The chaotic scene erupted around 11 a.m. on the last day of a particularly bitter legislative session in Austin, when demonstrators in the gallery of the House Chamber began chanting in opposition to a new law that bans so-called sanctuary cities. On the House floor, Representative Matt Rinaldi, a Republican, then turned to several Democratic lawmakers and told them he had reported the people to the federal Immigration and Customs Enforcement agency.

One of the Democrats, Representative César J. Blanco, said that Mr. Rinaldi told him and others, “We are going to have them deported,” and then used an obscenity.

“We were in shock,” Mr. Blanco said. “He assumed that because they were brown, in the gallery and protesting that they were here illegally.”