A Baltimore City Council committee agreed Tuesday to gut legislation originally designed to impose a mandatory one-year sentence on people who illegally carry guns, amending the measure to set tight limits on when it would apply.

The Judiciary and Legislative Investigations Committee voted 5-2 to advance the amended bill to the full council. The panel moved to water down the bill amid a contentious six-and-a-half-hour hearing, which at one point lapsed into chaos as members of the public clashed with police inside the council chamber.

The proposal has become a focal point in the debate over what to do about the record homicide rate in Baltimore this year. Supporters say it would be a useful tool to curb the violence, while opponents say the city risked returning to harsh crime-control policies of earlier decades.

But what emerged from the committee late Tuesday was a fairly minor piece of legislation. The committee unanimously adopted a pair of amendments that would make the mandatory sentence apply only on a second offense or if someone was carrying a gun “in connection with” a crime against a person or property.

Existing state laws already provide a mandatory minimum 1-year term on a second handgun possession offense. They also require a 5-year mandatory sentence for using guns in connection with violent crimes or drug dealing. The council bill would add a mandatory $1,000 fine.

Councilman John Bullock, considered a key swing vote, offered one of the amendments. He said later that the changes assuaged his qualms about supporting the bill. If his support holds, the measure would have the eight votes needed to pass the full council. “My concerns were the impact it would have on first-time offenders and people who were not committing any crimes of violence," he said.

Councilman Eric Costello, the committee chairman, said the bill still represented a commitment on the part of the council to fighting crime.

But he said he was disappointed with the changes to the measure. “It’s not as strong as I would like, but that’s the legislative process,” he said. “We have to compromise to get things done.”

The bill could be amended further on the floor of the City Council, where it is now scheduled for a preliminary vote next month.

The heightened emotions in the debate erupted when Costello invited members of the public to testify before the committee. He called up a group of doctors first, angering other people who felt they were being made to wait before having the chance to speak.

When Costello asked police to remove a man, some in the audience left their seats and confronted officers on the floor of the council chambers.

“We were here first,” people shouted from the balcony.

A 27-year-old man and a 29-year-old man were arrested, police said, and one of them was taken to the hospital complaining of chest pains. Police did not release their names.

Through mid-July, more than 500 people have been shot this year in the city, while gun arrests are down 31 percent. Police announced the latest homicide during the course of the hearing, bringing the city’s total for the year to nearly 200.

In response to the surge in violence, Mayor Catherine Pugh, Police Commissioner Kevin Davis and City Council President Bernard C. “Jack” Young backed the bill, which would have required a mandatory one-year sentence for illegal gun possession in much of the city — within 100 yards of a school, park, church, public building or other public place of assembly.

Supporters say they want to remove the discretion of judges to allow gun offenders to return to the street too quickly.

After the committee vote, Davis said he would wait to review the final version of the legislation, but cautioned against adopting something so weak that it “becomes virtually ineffective and becomes basically a paperweight.”

Pugh and Young could not be reached for comment.

Testifying before the committee Tuesday, Davis reeled off a list of names of men he said received short sentences after being convicted in gun cases, then went on to kill someone or were killed themselves. He called illegally carrying a gun an act of “pre-murder.”

Opponents argue that mandatory sentences are not effective and result in people being treated unfairly, especially if they are black. Councilman Brandon Scott, one of the two committee members to vote against the bill, said he couldn’t support the measure until he sees a detailed plan from city leaders for how to fight crime.

Baltimore Sun reporters Kevin Rector, Luke Broadwater and Michael Brice-Saddler contributed to this article.

iduncan@baltsun.com