Google is not obliged to delete personal information from its search results, even when that information damages an individual's reputation, an adviser to the European court of justice has decided.

In a long-running case about the "right to be forgotten" by search engines, judges have been asked to rule on whether Google should be treated under law as a publisher of information or simply a host.

The case is not due to conclude before the end of 2013 but if the court backs the adviser's findings it will spare Google from a flood of legal claims seeking the retraction of material from its searches.

The case is based on a complaint by Mario Costeja, a Spaniard who made a Google search of his name and found a newspaper announcement from 15 years earlier saying a property he owned was up for auction because of non-payment of social security contributions.

Costeja asked for the sensitive information to be deleted from Google's search results, arguing that his debts had been repaid and it was disproportionate that information that could damage his reputation with clients, employers or friends was so prominent so long after the event.

One of Spain's top courts upheld his complaint, deeming Google to be making money out of Costeja's personal data, and the case was referred to the European court of justice in March last year after Google challenged the decision.

Niilo Jääskinen, an advocate general of the European court of justice, said that companies operating in the European Union must adhere to national data protection legislation, but that did not oblige them to remove personal content produced by others.

"Requesting search engine service providers to suppress legitimate and legal information that has entered the public domain would entail an interference with the freedom of expression," the court said, in a statement communicating Jääskinen's opinion.

"Search engine service providers are not responsible, on the basis of the Data Protection Directive, for personal data appearing on web pages they process."

The court is not bound by the advocate general's opinion, but in most cases judges follow the recommendations. Google says it will remove defamatory or illegal information, but should not be asked to censor material published by third parties.

In a blogpost on Tuesday, Bill Echikson, Google's head of free expression in Europe, said: "In this case we're simply challenging the notion that information that is demonstrably legal – and that continues to be publicly available on the web – can be censored.

"People shouldn't be prevented from learning that a politician was convicted of taking a bribe, or that a doctor was convicted of malpractice. In order to achieve all the social, cultural and economic benefits of the internet, it must be kept free and open."

The problem arose because under Spanish law details of the repossession of Costeja's home were required to be published in a newspaper.

Costeja asked for both Google and the newspaper to remove the information from their archives, but the Spanish courts decided the newspaper was not obliged to purge its archive and that only Google had a case to answer.

The Spanish data protection authority has brought 180 such cases to Google, asking for information on individuals to be deleted.

While public notices are used to censure individuals in Spain and elsewhere, the internet has magnified their impact, by making the notice available not to a small number of readers buying a newspaper on one particular day, but any reader in the world for as many years as the notice remains archived online.

In his opinion, published on the court's website, Jääskinen declared: "The rights to erasure and blocking of data … do not confer on the data subject a right to address himself to a search engine service provider in order to prevent indexing of the information relating to him personally, published legally on third parties' web pages, invoking his wish that such information should not be known to internet users when he considers that it might be prejudicial to him or he wishes it to be consigned to oblivion."