U.S. lawmakers included language that would permanently protect some gun rights in Senate legislation intended to fund the government through the end of the current fiscal year.

Gun-rights advocates on the Senate Appropriations Committee added four firearms provisions to the funding bill as part of an agreement between Republicans and Democrats on the panel, according to a Senate aide who asked not to be identified in describing internal discussions.

Republicans on the committee are attempting to protect gun rights as the Democrat-led Senate Judiciary Committee this week advances measures aimed at curbing gun violence in the wake of a mass shooting at a Connecticut elementary school in December.

The agreement would make permanent the gun provisions, which have been in U.S. appropriations bills on a temporary basis since at least 2004, the aide said. The accord was an attempt by Democrats to stave off a House-sponsored measure related to semi-automatic rifles strongly opposed by President Barack Obama and gun-control advocates, the aide said.