Google’s challenges of gag orders to prevent it from notifying customers that their data was sought by the government thruogh warrants and court orders date to Jan. 2011. (Boris Roessler/EPA)

Google has fought all gag orders preventing it from telling customers that their e-mails and other data were sought by the U.S. government in a long-running investigation of the anti-secrecy group WikiLeaks, which published leaked diplomatic cables and military documents, an attorney representing the tech firm said this week.

The tech firm’s challenges date to January 2011 and include an attempt to overturn gag orders accompanying search warrants issued in March 2012 for the e-mails of three WikiLeaks staff members, said the attorney, Albert Gidari, in an interview.

Google’s long battle to inform its customers about the warrants and court orders has been fought largely in secret because of the court-imposed gags, hampering its effort to counter the impression that it has not stood up for users’ privacy, Gidari said.

In the latest instance, the three WikiLeaks staff members revealed this week that Google notified them on Dec. 23 that their e-mails were the subject of search warrants — almost three years after the broad warrants were issued by a magistrate judge in the Eastern District of Virginia.

“We are astonished and disturbed that Google waited over two and a half years to notify its subscribers,” Michael Ratner, an attorney for the staff members, wrote in a letter Monday to Google Chairman Eric Schmidt.

Google says it challenged the secrecy from the beginning and was able to alert the customers only after the gag orders on those warrants were partly lifted, said Gidari, a partner at the Perkins Coie law firm.

“From January 2011 to the present, Google has continued to fight to lift the gag orders on any legal process it has received on WikiLeaks,” he said, adding that the company’s policy is to challenge all gag orders that have indefinite time periods.

The affidavits and applications underlying the orders are still sealed. The company said it is seeking to unseal them.

Google’s belated disclosure contrasts with the way in which Twitter, the microblogging platform, was able to quickly inform several of its customers in 2011 that the federal government had demanded their subscriber data in the WikiLeaks inquiry.

According to Gidari, whose firm has represented both companies, Google’s delay was not the result of foot-dragging but of opposition from prosecutors who were upset by the backlash that followed the disclosure of their court orders to Twitter.

In December 2010, Twitter received a court order for subscriber information on five WikiLeaks staff members and supporters and promptly notified the Justice Department that it would inform them that their data was being sought. Rather than seek a court order to impose a gag on Twitter, prosecutors in the Eastern District of Virginia, apparently not foreseeing controversy, allowed the firm to notify its subscribers.

“usa government wants to know about all my tweets and more since november 1st 2009. do they realize i am a member of parliament in iceland?” tweeted Birgitta Jonsdottir, a WikiLeaks supporter.

The name of the assistant U.S. attorney, Tracy Doherty-McCormick, was included in the published material.

“The U.S. attorney’s office thought the notice and the resulting publicity was a disaster for them,” Gidari said. “They were very upset” about the prosecutor’s name and phone number being disclosed, he said. “They went through the roof.”

About the same time that the Twitter story broke, Google was served with a separate order for the data of Jacob Appelbaum, a WikiLeaks volunteer and security researcher. Google wanted to inform him, but prosecutors balked.

“There was a lot of pushback from the government because they also were getting pressure from the people who got served from Twitter,” Gidari said. “The U.S. attorney’s office is like, ‘Hell no — we’ll fight you forever.’ ”

For the next four years, “Google litigated up and down through the courts trying to get the orders modified so that notice could be given,” he said.

Joshua Stueve, a spokesman for the Eastern District of Virginia, declined to comment, citing the ongoing investigation of WikiLeaks.

In the fall of 2011, Google was able to tell Appelbaum that the government had sought data such as the IP addresses of the people he e-mailed with, according to a 2011 report in the Wall Street Journal.

Google also successfully challenged the gag orders on another court order and search warrant issued in 2011 in the WikiLeaks case, said Ahmed Ghappour, a professor at the University of California Hastings College of the Law, citing court documents.

A dozen outstanding search warrants and court orders have been issued in the WikiLeaks inquiry, said Ghappour, who is representing independent journalist Alexa O’Brien in her effort to have the documents unsealed. That is on top of the three disclosed last month, the orders disclosed by Twitter and one more revealed by a small Internet provider, Sonic, for data about whom Appelbaum e-mailed.

“The additional surveillance orders uncovered here seem to be the tip of the iceberg of a wide-ranging investigation now in its fifth year,” Ghappour said. “That such a broad dragnet could remain secret for so long defies principles such as transparency, speech and privacy, all fundamental to our democracy.”

Ratner, who is president emeritus of the Center for Constitutional Rights, said Google’s effort to challenge the gag order is “a positive development.”

But the case represents “an amazing Catch-22,” he said. Google does not “have the strongest right to challenge the scope or the reasonableness of the warrant. The only people who really have that are the targets of the warrant, and they don’t know about it. So essentially the government has carte blanche to get whatever they want.”