A Federal Court judge has ordered that Public Safety Minister Steven Blaney and the commissioner of the RCMP immediately hand over an external hard drive containing a copy of all Quebec gun registry data.

Judge Luc Martineau gave the government until 10 a.m. Tuesday to deliver the hard drive to the court, where it will be sealed until all legal challenges have been resolved over a controversial and retroactive Conservative law dealing with the defunct long-gun registry.

The order followed a day-long hearing in which government lawyers argued it was unnecessary to produce an physical copy of the records because the public safety minister had issued four separate undertakings to preserve the data.

Story continues below advertisement

It's the first legal skirmish in a battle between information commissioner Suzanne Legault and the Harper government over an unprecedented effort to use a budget bill to retroactively rewrite the application and enforcement of the Access to Information Act.

Legault's lawyer, Richard Dearden, will be back in court Tuesday to launch a constitutional challenge of Bill C-59, the Conservatives' latest omnibus budget bill, which is set to pass the final vote in the Senate this evening.

Legault says the RCMP broke the law when it destroyed gun registry records in 2012 despite an ongoing investigation and written assurances from the public safety minister that the data would be preserved until the matter was settled.