Federal investigators are looking into whether Google has been posting ads of illegal pharmacies, and the web giant has set aside $500 million for “a potential resolution” of a federal investigation, according to a Securities and Exchange Commission filing obtained by The New York Times.

As the Times reports, the U.S. Attorney’s office in Rhode Island is leading the probe of whether Google has posted ads by rogue pharmacies that illegally sell medications without prescriptions, as well as counterfeit drugs.

The Food and Drug Administration confirmed that it’s involved in the investigation. Neither the Department of Justice, the U.S. Attorney’s Office in Rhode Island, nor Google would comment.

For years Google has tried various methods to reduce the presence of rogue pharmacies on its search pages, resulting in changes to its ad policies. But a lawyer for the search engine giant described those efforts as “an ongoing, escalating cat-and-mouse game.”

In February, 2010, the company announced that it would only post ads for pharmacies certified by the National Association Boards of Pharmacy or its counterpart in Canada. Google also filed a lawsuit in September, 2010 against pharmaceutical companies that broke its advertising rules.

Critics of online drug-buying say that Google and other search engines need to do more to crack down, but acknowledged the difficulties. “It’s very hard to police these sites because they change every couple of days,” Joseph A. Califano Jr., founder of Columbia University’s National Center on Addiction and Substance Abuse, told the Times. “The only things that keeps them in business are the Googles of the world.”