A federal judge has ruled that Google Inc. must comply with the FBI's warrantless demands for customer data, rejecting the company's argument that the government's practice of issuing so-called national security letters to telecommunication companies, Internet service providers, banks and others was unconstitutional and unnecessary.

FBI counter-terrorism agents began issuing the secret letters, which don't require a judge's approval, after Congress passed the USA Patriot Act in the wake of the Sept. 11, 2001, attacks.

The letters are used to collect unlimited kinds of sensitive, private information, such as financial and phone records and have prompted complaints of government privacy violations in the name of national security. Many of Google's services, including its dominant search engine and the popular Gmail application, have become daily habits for millions of people.

In a ruling written May 20 and obtained Friday, U.S. District Court Judge Susan Illston ordered Google to comply with the FBI's demands.

But she put her ruling on hold until the 9th U.S. Circuit Court of Appeals could decide the matter. Until then, the Mountain View, Calif.-based company must comply with the letters unless it shows the FBI didn't follow proper procedures in making its demands for customer data in the 19 letters Google is challenging, she said.

After receiving sworn statements from two top-ranking FBI officials, Illston said she was satisfied that 17 of the 19 letters were issued properly. She wanted more information on two other letters.

It was unclear from the judge's ruling what type of information the government sought to obtain with the letters. It was also unclear who the government was targeting.

The decision from the San Francisco-based Illston comes several months after she ruled in a separate case brought by the Electronic Frontier Foundation over the letters. She ruled in March that the FBI's demand that recipients refrain from telling anyone — including customers — that they had received the letters was a violation of free speech rights.

Kurt Opsah, an attorney with the foundation, said it could be many more months before the appeals court rules on the constitutionality of the letters in the Google case.

"We are disappointed that the same judge who declared these letters unconstitutional is now requiring compliance with them," Opsah said on Friday.

Illston's May 20 order omits any mention of Google or that the proceedings have been closed to the public. But the judge said "the petitioner" was involved in a similar case filed on April 22 in New York federal court.

Public records show that on that same day, the federal government filed a "petition to enforce National Security Letter" against Google after the company declined to cooperate with government demands.

Google can still appeal Illston's decision. The company declined comment Friday.

In 2007, the Justice Department's inspector general found widespread violations in the FBI's use of the letters, including demands without proper authorization and information obtained in non-emergency circumstances. The FBI has tightened oversight of the system.

The FBI made 16,511 national security letter requests for information regarding 7,201 people in 2011, the latest data available.