NEW YORK (AP) — Yahoo scanned hundreds of millions of incoming emails at the behest of U.S. intelligence or law enforcement, according to a report published Tuesday.

The internet company conducted the surveillance last year after receiving a classified demand from the National Security Agency or the FBI, Reuters said in its story. The report cited three former Yahoo employees and another unidentified person familiar with the matter.

Those individuals told Reuters that the government pushed Yahoo to search for a string of letters, numbers or other characters. That meant the fishing expedition could have involved finding a specific phrase or code in the text of an email or an attachment.

NON-DENIALS AND DENIALS

Yahoo built a special software program to comply with the government's request, according to Reuters.

The Sunnyvale, California, company did not deny the report in a Tuesday statement that described itself as a company "that complies with the laws of the United States." The Department of Justice and the FBI did not immediately respond to requests for comment.

Google, whose Gmail is the world's largest email service, said Tuesday that it hadn't received a similar spying request from the request from the U.S. government. If it had, Google said, its response would be, "No way." Microsoft, whose email service also is larger than Yahoo's, also said it has "never engaged in the secret scanning of email traffic."

Twitter, which doesn't provide email service but does allow users to exchange direct messages, likewise said it has never received such a request and would challenge it in court if it did. Facebook said it would "fight" such a request should it ever receive one.

Civil libertarians also denounced the reported Yahoo action. Patrick Toomey, a staff attorney with the American Civil Liberties Union, called Yahoo's reported acquiescence to a government order "deeply disturbing," adding in his statement that the order itself appears to be "unprecedented and unconstitutional."

YAHOO'S LATEST EMAIL PROBLEM

The report will likely test the bounds of Yahoo users' already stressed loyalty.

Yahoo late last month disclosed that hackers had broken into at least 500 million user accounts to steal email addresses, birthdates, phone numbers and passwords. That theft, the biggest breach ever at an email provider, occurred in 2014 when Yahoo's security was run by Alex Stamos, who now holds a similar job at Facebook.

The cooperation with the government's spying on emails created a rift between Stamos and Yahoo CEO Marissa Mayer, prompting Stamos to leave in June 2015, according to Reuters.

Questions over Yahoo's stewardship of user email could threaten the company's deal to sell its online operations to Verizon Communications for $4.8 billion.

Verizon could renegotiate the terms or call the deal entirely if it the fallout from the massive hacking attack drives Yahoo users away from its email and other services, such as news, finance and sports.

After news of the breach broke last month, Verizon said it intended to act in its best interests without elaborating. Verizon had no comment on the Reuters report.