People should have some say over the results that pop up when they conduct a search of their own name online, Europe's highest court has ruled.

Google must amend some search results at the request of ordinary people, in an important test of the "right to be forgotten".

The European Court of Justice has ruled that the search engine company must listen – and sometimes comply – when individuals ask for the removal of links to newspaper articles or websites that contain personal information.

The landmark ruling has delighted privacy advocates but has angered technology companies.

The court ruled that the "fundamental" rights of EU citizens now include a "right to be forgotten" and that companies such as Google could be classed as personal "data controllers".

It came in an advisory judgment stemming from a lawsuit against Google – but will impact on all search engines, including Yahoo and Bing.

The case was referred to the European Court from Spain's National Court, which asked for advice in the case of Mario Costeja, a Spaniard who found a search on his name turned up links to a notice that his property was due to be auctioned because of an unpaid welfare debt.

The notice had been published in a Spanish newspaper in 1998, and was tracked by Google's robots when the newspaper digitised its archive.

Mr Costeja argued that the debt had long since been settled, and he asked the Spanish privacy agency to have the reference removed. In 2010, the agency agreed, but Google refused and took the matter to court, saying it should not be asked to censor material that had been legally published by the newspaper.

The Court of Justice said a search on a person's name yields a results page that amounts to an individual profile, and a person has some right to control this under European privacy laws.

The court said people should be able to ask to have links to private information removed, even when a non-Google website is still hosting the information.

"A supervisory authority or judicial authority may order the operator of the search engine to remove... results displayed following a search made on the basis of a person's name," said the court's ruling.

The court said that such an event could be ordered even if the article linked to was lawfully published and remained online.

The court ruled that local judges or data protection commissioners may now decide if internet companies and publishers should delete references to individuals who want their names removed from articles.

While online privacy advocates welcomed the ruling, tech companies have greeted the decision with dismay.

"This is a disappointing ruling for search engines and online publishers in general," said a spokesman for Google.

"We are very surprised that it differs so dramatically from the Advocate General's opinion and the warnings and consequences that he spelled out. We now need to take time to analyse the implications."

However, Mr Costeja was jubilant. "It's a great relief to be shown that you were right when you have fought for your ideas. It's a joy," he said.

Some Irish tech entrepreneurs have previously warned of a gulf emerging between the US and Europe in a clash between privacy and "openness".

"Right now, the places that create the most jobs embrace a collaborative culture over the strictest privacy culture," said Mark Little, former RTE journalist and founder of €18m startup Storyful.

"Yet in countries like Germany, the number one thing they talk to you about is the need to protect privacy. I think we might be missing something in Europe. We need to amplify openness."

Mr Little was speaking to a gathering of technology entrepreneurs in Dublin last week.

However, the European Court Of Justice ruled that economic factors could not be taken as a reason for tempering citizens' right to privacy.

"It is clear that it cannot be justified by merely the economic interest which the operator of such an engine has."

But a "fair balance" between privacy and public interest issues was required when deciding whether to order search engines or publishers to delete references to personal names.

This would be guided by "the nature of the information in question and its sensitivity for the data subject's private life".

But there would also be consideration of "the interest of the public in having that information, which may vary according to the role played by the data subject in public life".

Irish Independent