Yahoo in April of last year began secretly scanning the incoming emails of its hundreds of millions of users to comply with an order from the U.S. intelligence community, a move that prompted at least two company officials to leave, according to a former Yahoo employee familiar with the matter.

The company’s decision not to fight the order from intelligence officials caused Yahoo’s then-chief information security officer Alex Stamos to resign last year – and at least one other security staffer left the company – due to ethical concerns about the surveillance program, according to the person, who spoke on the condition of anonymity because the matter was confidential. Reuters, citing unnamed former employees, first reported the news Tuesday.

The government’s demand to scan email in real time alarmed privacy advocates, as did Yahoo’s compliance with such a broad order. Patrick Toomey, a staff attorney with the American Civil Liberties Union, called the order “unprecedented and unconstitutional.”

“It is deeply disappointing that Yahoo declined to challenge this sweeping surveillance order, because customers are counting on technology companies to stand up to novel spying demands in court,” he said in a statement.

Google, which runs Gmail, said in a statement: “We’ve never received such a request, but if we did, our response would be simple: ‘no way.’ ” Microsoft, another major email provider, said, “We have never engaged in the secret scanning of email traffic like what has been reported today about Yahoo.”

It was unclear which intelligence agency directed Yahoo to scan emails, the person familiar with the matter said. It’s also unknown what the government officials were looking for and what, if any, data Yahoo turned over to the government, the person said. The Office of the Director of National Intelligence did not respond to a request for comment.

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

The company has fought a previous government request for data. In 2007, Yahoo unsuccessfully argued as unconstitutional an intelligence community demand that it hand over communications to and from foreign targets without individual search warrants.

The challenge was heard in the Foreign Intelligence Surveillance Court and details about the case have remained under seal. But documents declassified in 2014 showed that the government threatened Yahoo with a massive $250,000 per day fine if it did not comply.

But Yahoo CEO Marissa Mayer’s decision to obey the order last year upset Stamos and some other senior executives.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.