WASHINGTON — Apple Inc. on Thursday asked a federal magistrate to reverse her order that the company help the FBI hack into a locked iPhone, accusing the federal government of seeking “dangerous power” through the courts and of trampling on its constitutional rights.

The filing represents Apple’s first official response since the judge’s order last week and builds upon arguments voiced by the company’s chief executive and supporters. It marks the latest salvo in a court fight that could create meaningful precedent and establish new legal boundaries in the policy battle between national security and digital privacy – a clash FBI Director James Comey says is the “hardest question I’ve seen in government.”

“No court has ever authorized what the government now seeks, no law supports such unlimited and sweeping use of the judicial process, and the Constitution forbids it,” Apple said.

The Justice Department is proposing a “boundless interpretation” of the law that, if left unchecked, could bring disastrous repercussions, the company warned in a memo submitted to Magistrate Sheri Pym that aggressively challenges policy justifications put forward by the Obama administration in the last several days.

“The government says: ‘Just this once’ and ‘Just this phone.’ But the government knows those statements are not true,” lawyers for Apple wrote.

If Apple were required to build the software the FBI wants, the lawyers argued, “criminals, terrorists and hackers will no doubt view the code as a major prize and can be expected to go to considerable lengths to steal it.”

Justice Department lawyers were reviewing Apple’s brief and will respond, said spokeswoman Melanie Newman. She said Apple had reversed “its long-standing” cooperation with government requests, and that when Justice Department officials want to search a phone or another electronic device, “we narrowly target our request to apply to the individual device” and get a judge’s approval.