The company that is in the midst of being sold to Verizon has just been exposed for secretly building software to search all of its customers' emails for information at the request of U.S. intelligence officials, Reuters reported Tuesday.

According to two former employees speaking anonymously to Reuters, the company complied to the request that was sent from either the National Security Agency or the FBI to Yahoo's legal team.

The software reportedly had the ability to search all of Yahoo Mail accounts in real time.

It is not known if Yahoo handed any information over to the government.

“Yahoo is a law abiding company, and complies with the laws of the United States," Yahoo said in a statement to Mashable.

The decision came even as Yahoo had previously fought against such government requests that violated user privacy. In 2007, Yahoo fought against the NSA's PRISM program, the classified program on tapping user data that also included companies like Google Facebook, Microsoft and Apple. Yahoo ended up losing that battle.

This time around, according to report, Yahoo did not put up a fight. That decision, by Yahoo CEO Marissa Mayer, reportedly led to the resignation of Alex Stamos, formerly Yahoo chief security officer who later joined Facebook.

The U.S. government could have made this request to other tech companies as well.

Glenn Greenwald, a journalist for The Intercept who also has worked with Edward Snowden on stories about the U.S. government's data collection, speculated that other companies were at least asked to do something similar.

Microsoft said in a statement, "We have never engaged in the secret scanning of email traffic like what has been reported today about Yahoo.”

Both Twitter and Google not only denied engaging in the same type of practice but said it never received such a request from U.S. officials.

"We've never received such a request, but if we did, our response would be simple: 'no way,'" a Google spokesperson wrote in an email to Mashable.

“We've never received a request like this, and were we to receive it we'd challenge it in a court," a Twitter spokesperson wrote to Mashable.

Twitter also pointed to a lawsuit the company filed in 2014 over the ability to reveal such surveillance requests. "Separately, while federal law prohibits companies from being able to share information about certain types of national security related requests, we are currently suing the Justice Department for the ability to disclose more information about government requests," Twitter wrote in its statement.

Facebook and Apple responded to Mashable's requests for comment later Tuesday evening.

"Facebook has never received a request like the one described in these news reports from any government, and if we did we would fight it," a Facebook spokesperson wrote in an emailed statement.

“We have never received a request of this type. If we were to receive one, we would oppose it in court," Apple said in a statement.

Mashable
is a global, multi-platform media and entertainment company. Powered by its own proprietary technology, Mashable is the go-to source for tech, digital culture and entertainment content for its dedicated and influential audience around the globe.