Google won a major legal victory Wednesday when a federal judge said the search engine could continue to sell ads triggered by searches using trademarked company names.

U.S. District Judge Leonie Brinkema rejected a claim by auto insurance giant Geico Corp., which argued that Google should not be allowed to sell ads to rival insurance companies that appear whenever Geico’s name is typed into the Google search box.