Google has apologised after photographs of the Indian prime minister started appearing in image search results for “top 10 criminals”.

Narendra Modi, who took office last year, appears alongside notorious gangsters, murderers, dictators and Justin Bieber in the search results.

Google said it was sorry “for any confusion or misunderstanding” and blamed the results on a unspecified British news site that had published an image of Modi with erroneous metadata, the often invisible information used by websites to describe photographs and other content.

“These results trouble us and are not reflective of the opinions of Google,” it said. “Sometimes, the way images are described on the internet can yield surprising results to specific queries. We apologise for any confusion or misunderstanding this has caused. We’re continually working to improve our algorithms to prevent unexpected results like this.”

Google image search for “top 10 criminals”. Photograph: Google Screengrab/The Guardian

Other results for the search query “top 10 criminals” include George W Bush, Muammar Gaddafi and Osama bin Laden.

Several well-known Indians come up in the search results, including Delhi’s chief minister, Arvind Kejriwal; Dawood Ibrahim, a fugitive underworld leader, and Sanjay Dutt, a Bollywood actor serving a jail term in connection with deadly blasts in Mumbai in 1993.

Below the search box, the results page states: “These results don’t reflect Google’s opinion or our beliefs; our algorithms automatically matched the query to web pages with these images.”

Google said multiple news articles with images of Modi reported his comments about politicians with criminal backgrounds. It said the articles did not link Modi to criminal activity but the words appeared in close proximity to his name.

Last month Google apologised after searches that included racist terms in connection with Barack Obama found the White House on Google Maps. In 2010 the company’s search auto-complete system suggested racist queries when typing the word “why”.

A study by a Harvard professor found that Google’s advertising system was 25% more likely to bring up ads for criminal record checks when searching for names associated with African-Americans.