Google has agreed to a $500 million settlement to end the government’s probe into the company’s distribution of online ads from Canadian pharmaceutical companies illegally selling prescription drugs to Americans.

As part of the settlement agreement, Google will not face criminal prosecution in this case. Google was accused of profiting from Canadian pharmaceutical companies’ ads. Via Google’s ads, those companies sold prescription drugs to U.S. consumers, then illegally imported them across the border.

Google said in a statement it shouldn’t have let those companies market the drugs to Americans. Read the AP’s report