SAN FRANCISCO - A federal appeals court has made it more difficult for employers to legally snoop on their workers' electronic communications sent on company accounts.

A ruling by the 9th U.S. Circuit Court of Appeals in San Francisco on Wednesday says employers who contract an outside business to transmit text messages can't read them unless the worker agrees.

However, the ruling lets employers access employee e-mails if they are kept on an internal server.

Judge Kim Wardlaw, who wrote the three-judge panel's unanimous opinion, says users of text messaging services "have a reasonable expectation of privacy" if their messages stored on the service provider's network.

The text message part of the ruling will affect more employers.

According to analysts, the majority of U.S. companies pay outside parties to transmit their workers' text messages but most keep their workers' e-mail on internal servers.

The judges had few legal pathways to follow, Wardlaw acknowledged in the ruling.

"The extent to which the Fourth Amendment provides protection for the contents of electronic communications in the Internet Age is an open question," she wrote.

One non-profit civil liberties group called the ruling a "tremendous victory" for online privacy.

The court has helped ensure the Fourth Amendment "applies to your communications online just as strongly as it does to packages and letters," the Electronic Frontier Foundation said in a posting.

The case originated from a lawsuit by Ontario police Sgt. Jeff Quon and three other officers. They sued after wireless provider Arch Wireless turned over to the police department transcripts of Quon's text messages to them in 2002. Police officials read them to determine whether department-issued pagers were being used solely for work purposes.

"I think right now service providers are going to be a little leery of providing anything to the subscriber because of this case," said John Horowitz, a lawyer representing Arch Wireless.

Dimitrios Rinos, a lawyer for the city of Ontario and its police department, said his clients probably will appeal the ruling.