Online pharmacies selling counterfeit drugs or not requiring prescriptions advertised on Google. Google allowed it to continue and now is setting aside $500 million to ward off criminal charges by settling.

Google is close to settling a criminal investigation, people familiar with the matter told the Wall Street Journal. Google revealed the $500 million charge in a Securities and Exchange Commission filing this week.

Google would only say in the filing that the investigation involved the use of Google advertising by certain advertisers.

A federal investigation claims Google violated its own ad policies. Many online pharmacies that advertised on Google never went through Google's vetting process, which require them to be approved by PharmacyChecker.com, an executive at the site told the New York Times.