An external drive containing a copy of all Quebec gun registry data has been handed over, a federal court clerk has confirmed to CTV News.

A court spokesperson told CTV's Katie Simpson that the hard drive was transferred at approximately 9:25 on Tuesday morning, a little more than 30 minutes ahead of the court-imposed deadline.

The hard drive will be kept in a safe, the spokesperson said.

After a day-long hearing on Monday, federal court Judge Luc Martineau gave Public Safety Minister Steven Blaney and the commissioner of the RCMP until 10 a.m. to deliver the hard drive.

Government lawyers had argued that there was no need to relinquish the actual hard drive, after the minister had given his assurances that the data it contained would be preserved until all legal challenges were resolved.

The controversy stems from the federal government's attempt, in its omnibus budget Bill C-59, to retroactively rewrite Canada's Access to Information law.

The backdated changes would prevent possible criminal charges against the RCMP related to the destruction of the gun registry data.

Information Commissioner Suzanne Legault has said the RCMP broke the law when it destroyed gun registry records in 2012.

In an affidavit filed earlier this month, Legault noted that the Ending the Long-gun Registry Act made the Commissioner of Firearms responsible for ensuring all Canadian Firearms Registry records be destroyed as soon as possible, and added that any prior Access to Information Act would require that the records be saved.

Legault’s lawyer, Richard Dearden, is back in court to launch a constitutional challenge of the omnibus budget bill, ahead of its expected passage in a final Senate vote set for Tuesday evening.

Despite the court order Monday, the government stood firm.

"The will of Parliament has been clear on multiple occasions; all copies of the registry are to be destroyed," Blaney's spokesman Jeremy Laurin said in an email to The Canadian Press. "We will continue to stand up for this position in court."

With files from CTV's Katie Simpson and The Canadian Press