By Joseph Ax

(Reuters) - Democrats in the New Jersey General Assembly narrowly failed on Thursday to override Governor Chris Christie's veto of a gun safety bill, sparing him a political rebuke as he campaigns for the 2016 Republican presidential nomination.

After more than an hour of debate, during which several lawmakers invoked Wednesday's mass shooting in California that killed 14, Democrats in the 80-member chamber appeared to be three votes short of securing the 54 needed to override Christie's veto.

The bill was pulled before the vote was formally recorded, which allows Assembly Speaker Vincent Prieto to introduce the legislation again at a later date.

"I will put this bill back up again and again," he said in a statement criticizing Republicans.

Democrats control 47 seats in the Assembly.

The state Senate had already completed the first half of an override in October, when a handful of Republicans joined Democrats to reach the 27 votes needed in the 40-member chamber.

Christie vetoed the bill in August after it passed overwhelmingly in both houses, including by a vote of 74-0 in the Assembly.

He has boasted on the campaign trail that none of his hundreds of vetoes have been overturned by the legislature since he took office in 2010. A spokesman for the governor's office declined to comment, and instead referred to the governor's statements on the issue in November, when he said Democrats should "stop playing politics" and fix the problem.

Gun control has been a hot-button issue in the 2016 presidential race following a string of deadly mass shootings in the United States.

The legislation calls for police to be consulted when judges determine whether to expunge mental health records of prospective gun buyers.

Federal law prohibits the purchase of firearms by anyone who has been involuntarily committed to a mental health facility, but that record can be erased by a judge if the person is deemed unlikely to pose a public danger.

Story continues

Members of both parties traded recriminations on Thursday, with Democratic legislators criticizing Republicans for flip-flopping and Republicans accusing Democrats of playing politics themselves.

"This bill has nothing to do with politics," said Democratic Assemblyman Gordon Johnson, the bill's chief sponsor. "This bill is all about public safety."

But Scott Rumana, a Republican lawmaker, said the law had "a loophole as big as a Mack truck" and echoed Christie's calls for more comprehensive solutions.

(Reporting by Joseph Ax in New York; Editing by Steve Orlofsky and Dan Grebler)