The FBI withdrew a national security letter targeting an Office 365 enterprise customer following Microsoft's challenge to a provision of the letter gagging the company from informing the target, according to court documents unsealed Thursday.

"In this case, the Letter included a nondisclosure provision and we moved forward to challenge it in court. We concluded that the nondisclosure provision was unlawful and violated our Constitutional right to free expression. It did so by hindering our practice of notifying enterprise customers when we receive legal orders related to their data," Brad Smith, Microsoft's general counsel wrote in a blog post Thursday.

While it's not everyday that a company's policy benefits the customer, the flap highlights the unsettled state of gag orders associated with national security letters. The letters, which come directly from the FBI, require entities like Internet companies, banks, or others to cough up a wealth of information to the authorities. Recipients of them are generally forbidden from disclosing them.

However, a federal judge ruled last year that such gag orders violate the First Amendment rights of those receiving them, and she declared the letters unconstitutional. The decision has been stayed and is pending appeal.

The existence of the legal tussle between the FBI and Microsoft was unsealed in court documents (PDF) Thursday. The name of the targeted Microsoft customer was blacked out in the records. The 2013 national security letter was not included in the documents.

Still, the authorities managed to prevail anyway and scored the information directly from Microsoft's customer, according to the record.

"The FBI obtained the requested information through lawful means from a third party, the Customer, in a way that maintains the confidentiality of the underlying investigation," the record shows.