A federal judge Wednesday handed online search engine Google Inc. (GOOG) a victory in a trademark infringement case Wednesday, ruling that when users searched for insurer GEICO, Google could display rivals as well.

U.S. District Judge Leonie Brinkema of the Eastern District of Virginia said there was not enough evidence of trademark violation in the suit by Maryland-based GEICO, a subsidiary of billionaire investor Warren Buffett's (search) holding company Berkshire Hathaway Inc. (search).

Google said it was very pleased with the decision. "This is a clear signal to other litigants that our keyword policy is lawful," said Google General Counsel David Drummond.

Brinkema announced her decision in court after presiding over two days of proceedings in which GEICO outlined its case.

The move came in response to a motion by Google's lawyers, who asked the judge to dismiss the entire case on legal grounds.

Brinkema agreed in part, but said she would allow the case to proceed on the narrower question of whether Google should be barred from displaying advertisements for other insurers that contain the word "GEICO."

An analyst said the court's ruling lifts what amounts to the biggest legal risk to Google's business of selling advertisements based on keyword searches by its users.

"It is a pretty firm and clear-cut decision that is good for Google," said Martin Pyykkonen, a financial analyst with Janco Partners who tracks Internet stocks.

Google derives most of its revenue from selling ads that are triggered when visitors to its site search for specific terms such as "Geico low-cost auto insurance." Google reported revenue of $806 million during its most recent quarter.

GEICO, which sells low-cost insurance directly to the public, is one of several companies which have challenged how Google allows competitors to use their trademarked names to generate advertisements linked to the the Web sites of rivals.

"If this case had proceeded as it was, hundreds of thousands of companies might take issue with keyword ads and comparison-shopping," Pyykkonen said.

A lawyer representing another company suing Google, privately held American Blind and Wallpaper, said Brinkema's decision would not affect other similar suits against the search engine.

"You can't look at this decision as a sweeping per se ruling that Google can profit by selling other companies' trademarks," said David Rammelt, who represents American Blind.

Other online companies who offer comparison-shopping features on their site could also have been hit — including Yahoo Inc. (YHOO), eBay Inc. (EBAY) and Amazon.com Inc. (AMZN), the analyst said.

Google says it already has a policy to exclude such ads. An attorney for Google told Brinkema the policy was "not perfect" but that was insufficient ground for finding against Google.

An attorney for GEICO told reporters afterward that Brinkema had given both sides part of what they wanted. He said GEICO would continue to seek an injunction banning Google from displaying ads containing the word "GEICO."

"GEICO will continue to aggressively enforce its trademark rights against purchasers of its trademark on search engines and against search engines that continue to sell its trademarks," GEICO General Counsel Charles Davies said in a statement later in the day.

Brinkema adjourned the case for several weeks while she writes an opinion and encouraged both sides to continue settlement talks.

Pyykkonen said the judge's move preserves a distinction in trademark law that allows for coincidental juxtaposition of one company's advertising against rivals but draws a line when one company attacks another party in print via its own ads.

Keyword-searches can be understood as the online equivalent of consumers holding a company's in-store discount coupon electing to buy a rival's product, the analyst said. He contrasted that with traditional trademark violations in magazines, in which one advertiser uses an ad to bash the products of a rival.

Shares of Google's high-flying stock rose $1.31 to $180.00 on Nasdaq.