A bill that would have banned military-style rifles in Virginia was defeated in the State Senate on Monday, a sign of the limited power of the state’s new Democratic majority in enacting the most restrictive elements of its gun-control agenda and a blow to Gov. Ralph Northam’s efforts to restrict gun possession.

The prohibition on military-style rifles was the most contentious of a series of gun-control bills making their way through the State Legislature this year and the centerpiece of Democrats’ attempts to restrict firearms after a gunman fatally shot 12 people in Virginia Beach last May.

The state is at the heart of a long-simmering debate related to the nation’s uneasy accommodation regarding gun laws, with Democrats in the state’s urban areas and suburbs supporting gun-control measures, while many rural residents have mounted large gun-rights protests in response.

The assault-weapons bill rejected Monday would have prohibited the sale, purchase, manufacture and most transfers of military-style weapons, as well as large-capacity magazines holding more than 12 rounds. It would have also banned trigger activators, including bump stocks, designed to make weapons simulate automatic machine gun fire.