The Massachusetts Senate passed a wide-ranging gun bill Thursday, but not before stripping it of a key provision that would have given local police chiefs more discretion to deny licenses for rifles and shotguns.

The provision was in the house bill that passed last week but dropped from the senate version at the last minute. Gun control advocates were fuming.

“The senate just stripped out the most important piece of the gun bill and people will die as a result of it,” said John Rosenthal, of the group Stop Handgun Violence.

Senators approved the bill on a voice vote, which means they don’t have to be individually recorded on how they vote.

Rosenthal was furious.

“They’re cowards," he said. "If they were going to cave into the gun lobby, they should be on the record.”

State Sen. Jamie Eldridge, a Democrat from acton, said that senators were under pressure from the National Rifle Association.

“I think for those that are truly concerned with gun violence throughout Massachusetts, they really need to be more vocal," he said. "And their lack of being vocal has affected the direction of this bill.”

Jim Wallace of the Gun Owners Action League, the local affiliate of the NRA, praised the legislation.

“We are in a place right now of making history because we have a bill that deals with public safety, that deals with mental health, that deals with school safety, that deals with fighting gun crime, that still respects the civil rights of gun owners,” he said.

The bill makes several changes to the state’s gun laws, which are already among the strictest in the nation. It would allow real-time background checks during private gun sales. It would also require Massachusetts to submit mental health records to the national gun database.

The bill now heads to conference committee. The House and Senate have until July 31 to hammer out a compromise.