IBM has not relinquished its customers' data to the US government and would challenge any orders to do so, the company said in a blog post over the weekend.
The post by the world's largest technology service provider is the latest backlash by a tech company against US electronic surveillance practices, following reports alleging the government spread malware to break into computers.
"IBM has not provided client data to the NSA or any other government agency under any surveillance program involving the bulk collection of content or metadata," Robert Weber, IBM's senior vice president of legal and regulatory affairs, wrote in the blog post.
"If the US government were to serve a national security order on IBM to obtain data from an enterprise client and impose a gag order that prohibits IBM from notifying that client, IBM will take appropriate steps to challenge the gag order through judicial action or other means."
He said the company would challenge national security orders to obtain data stored outside the United States, and that efforts to access that data should go through recognised legal channels like treaties.
The NSA has "co-opted" more than 140,000 computers since August 2007 to inject them with spying software, according to a slide leaked by former NSA contractor Edward Snowden.
In a statement, the NSA said the reports were "inaccurate" and it does not target users of global internet services without appropriate legal authority.
"Reports of indiscriminate computer exploitation operations are simply false," the agency said.
IBM is one of several US tech companies hit by the growing government spying scandal. Its sales to China fell by 20 percent in the second half of last year as Beijing encouraged state- owned companies to buy China-branded products on fears of US government spying.
In the post, Weber also called for greater transparency and a robust debate about government surveillance.
"Data is the next great natural resource, with the potential to improve lives and transform institutions for the better. However, establishing and maintaining the public's trust in new technologies is essential," he wrote.
On Thursday, Facebook CEO Mark Zuckerberg also blasted the US government's electronic spying.
"When our engineers work tirelessly to improve security, we imagine we're protecting you against criminals, not our own government," Zuckerberg said in a post on his personal Facebook page.
The documents showed the NSA impersonated Facebook web servers in order to gather information from targets. When those people thought they were logging into Facebook, they were actually communicating with the NSA. The agency then used malicious code on the fake page to break into the targets' computers.
The agency rejected the reports and declined impersonating any US company websites.