WASHINGTON — An American communications company in 2014 balked at an “expansion” of the National Security Agency’s warrantless surveillance program, but was ordered to comply by the Foreign Intelligence Surveillance Court, a newly declassified document shows.

The previously secret fight, which played out quietly amid a public debate over surveillance that was prompted by the 2013 leaks by the intelligence contractor Edward J. Snowden, was described in a 37-page ruling issued in 2014 by Judge Rosemary M. Collyer.

The ruling was heavily redacted when it was made public this week. Its uncensored portions did not say whether the challenge was brought by a telecommunications provider like AT&T that is part of the program’s “upstream” system or by a Silicon Valley internet company like Google that is part of the program’s “Prism” system.

It also did not say what the “expansion” was or what legal arguments the company had made about it.

Still, the disclosure was significant. Although several users and privacy groups have tried to sue to block spying under the FISA Amendments Act, the 2008 law that legalized a form of the Bush administration’s post-Sept. 11 warrantless surveillance program, the 2014 fight is the first time that a communications company that works with the N.S.A. is known to have challenged it.