U.S. District Judge Richard Leon ruled on Monday that the National Security Agency's data mining of all phone records may be unconstitutional.

Though the federal judge ruled in favor of the activist Larry Klayman's lawsuit against the NSA's spying and collection program, he delayed his injunction to allow the Justice Department time to appeal the ruling, USA Today reports.

In the ruling, the judge wrote, "The court concludes that plaintiffs have standing to challenge the constitutionality of the government's bulk collection and querying of phone record metadata, that they have demonstrated a substantial likelihood of success on the merits of their Fourth Amendment claim and that they will suffer irreparable harm absent…relief."

This shut down the defense that Justice Department attorney James Gilligan had argued as they believed that the lawsuit was meritless as Klayman couldn't prove the NSA actually looked at his phone records.

According to NBC News, the judge also noted that the technology was "almost-Orwellian."

Leon wrote that most of the NSA's justifications to use its data mining of phone records was based on an out of date Supreme Court ruling that occurred decades before anyone could have predicted the current advancement of phone technology.

He also noted that while some information provided by phone companies could be acceptable, what had actually been going on was another thing entirely.