The Alabama Legislature is telling the federal government and others to back off on gun control.

The Senate passed legislation Tuesday declaring that “All federal acts, laws, orders, rules or regulations regarding firearms are a violation of the Second Amendment.” It also says federal laws in violation of the Second Amendment shall be considered null and void in Alabama. The vote was 24-6.

The sponsor, Republican Sen. Paul Sanford of Huntsville, said the bill resulted from hundreds of emails and calls he received from his north Alabama constituents concerned that Congress might enact new gun regulations or restore the previous ban on assault weapons. He said the assault weapon ban is an example of federal regulation that he considers a violation of the Second Amendment.

Democratic Sen. Bobby Singleton of Greensboro, who voted against the measure, said state law can’t trump federal law. “This bill is null and void on its face,” Singleton said.

In the House Tuesday, members voted 76-22 for a proposed constitutional amendment that would require Alabama’s courts to use “strict scrutiny” when reviewing any new gun control laws. That would require proponents of the laws to show a compelling interest for the regulations and that they be narrowly tailored.

The Second Amendment bill sponsored by Republican Rep. Mike Jones of Andalusia was part of the “We Dare Defend Our Rights” agenda that the House Republican Caucus set for the 2013 session. To take effect, the bill still must be passed by the Senate and approved by Alabama voters in a statewide referendum.

In the Senate, Sanford said he was not trying to declare all federal gun laws void. Instead, he said he hoped that if Congress were to pass gun controls, the legislation would permit the state attorney general to issue an opinion that the law was unconstitutional and then Alabama law enforcement officers could refrain from enforcing it.

“We are going to declare it null and void and not participate with the federal government,” said Sanford, who has a pistol permit and regularly carries a gun.

Republican Sen. Dick Brewbaker of Montgomery voted for the bill, but he said states trying to nullify federal laws have been losing ever since the 1830s when South Carolina tried it with a federal tariff in President Andrew Jackson’s administration.

Sanford’s bill would have to pass the House and be signed by the governor to become law. He said House approval will be hard to get because the Legislature has only four meeting days left in the 2013 session. “We are so late in the session, it makes it difficult to pass anything,” he said.

The bill comes two weeks after Kansas’ Republican governor, Sam Brownback, signed a law providing that all Kansas-made guns that have not left Kansas are exempt from federal gun control laws.

Immediately after passing Sanford’s bill, the Senate passed a bill by Brewbaker allowing all city and county school systems to hire armed officers through their local sheriff and police departments to provide security in public schools. That bill, recommended by the state’s School Safety Commission, also needs approval of the House and the governor to become law.