For about 40 minutes on Saturday, from 2.30pm GMT, every Google search result worldwide was accompanied with the warning message: "This site may harm your computer".
Users were stopped from directly clicking through to any site listed in the results.
Google said the problem was a result of "human error".
The internet giant usually flags search results with the message "This site may harm your computer" if the site is known to install malicious software in the background.
A list of these harmful sites is maintained through both manual and automated methods, in conjunction with a non-profit organisation called StopBadware.org.
Google said it periodically updates the list and released one such update on Saturday.
Marissa Mayer, vice president of search products and user experience, said on Google's blog: "The URL of '/' was mistakenly checked in as a value to the file and '/' expands to all URLs.
"Fortunately, our on-call site reliability team found the problem quickly and reverted the file.
"Our apologies to any of you who were inconvenienced, and to site owners whose pages were incorrectly labelled.
"We will carefully investigate this incident and put more robust file checks in place to prevent it from happening again."
Google's search engine is the world's most popular, accounting for almost four out of every five internet searches.