Regulators will announce Wednesday that Google will pay $500 million to settle government charges that it has illegally shown ads for online pharmacies that operate outside the law, according to two people briefed on the investigation.

The investigation was first revealed in May, when Google said in a government filing that it set aside $500 million for the potential settlement of a Department of Justice investigation into its advertising practices, which decreased its quarterly profits by 22 percent.

At the time, government officials said the investigation concerned ads from online pharmacies that operate illegally by failing to require a prescription or selling counterfeit drugs. Google has said in the past that regulating these pharmacies on its site is a cat-and-mouse game, because when it introduces rules to prevent them from advertising, they find new ways to appear on Google.

Web sites are liable for ads on their sites from advertisers that break federal criminal law.

The announcement is expected to come at a press conference held by the United States Attorney's office in Rhode Island, which has led the investigation. The United States Attorney's office announced that it will hold a conference to announce the outcome of an investigation Wednesday at 11 a.m. with Peter F. Neronha, the United States Attorney for the District of Rhode Island, and Kathleen Martin-Weis, acting director of the Food and Drug Administration's Office of Criminal Investigations.

This story originally appeared in The New York Times