Google is reportedly set to hand over half a billion dollars to the feds to settle a criminal investigation into the search giant profiting from rogue pharmacy ads, according to the Wall Street Journal.

Google revealed a hint of the settlement earlier this week in a filing to the SEC that said it was setting aside $500 million for a government settlement, but didn’t specify why.

According to the WSJ’s Thursday report, the FDA and Rhode Island’s attorney general have been looking into whether Google profited illegally from ads placed by non-US pharmacies. Google and other search sites blocked many overseas pharmacy ads in early 2010, because it’s illegal for U.S. citizens to have such drugs imported.

Google did, however, make an exception for Canadian pharmacies—though it limited them to ones approved by a licensing body.

That compromise may not have been enough or soon enough for the authorities, who look set to extract a very large penalty from the search and online ad giant. Importing drugs into the US is not legal, though the feds almost always turn a blind eye to drugs from Canada and don’t prosecute individuals.

Google changed its policy on pharmacy ads in February 2010, so that it would only take ads from US pharmacies accredited by the National Association of Boards of Pharmacy, and from online pharmacies in Canada that are accredited by the Canadian International Pharmacy Association.

US citizens order from Canadian and overseas pharmacies to get cheaper prices on medicine, though it’s illegal even with a prescription or for drugs not available in the I.S.. Online ordering also carries a higher risk of encountering counterfeit pills. Last summer, a 22 year-old Canadian was sentenced to 33 months in a U.S. federal prison for selling fake cancer-fighting drugs over the internet.

Still, it’s not clear that extracting $500 million from Google’s rather full coffers is going to do much to stop the business of online pharmacies. Those sites are already masters of spam e-mails and spam websites, in no small part because expensive prescription drugs and health insurance create a lot of demand.

And now instead of paying a US-based company for online ads, those pharmacies will simply invest that money into getting to the top of that site’s search results by spending more money on spammy websites and black-hat SEO.