Google has agreed to pay $500m (£305m) to settle accusations it allowed online Canadian pharmacies to advertise drugs to Americans via its AdWords service.
The payment, announced by the US justice department, means the company will not face criminal charges.
Google was aware that US law bars most importation of drugs from pharmacies outside the country, authorities said.
The sum represents revenue Google earned from the adverts and the pharmacies' earnings, authorities said.
"The Department of Justice will continue to hold accountable companies who in their bid for profits violate federal law and put at risk the health and safety of American consumers," Deputy Attorney General James Cole said in a statement.
"This settlement ensures that Google will reform its improper advertising practices with regard to these pharmacies while paying one of the largest financial forfeiture penalties in history."
Under the terms of the settlement, Google acknowledged it had improperly aided the Canadian online pharmacies market their products to Americans.
Analysts say any damage to Google, based in Mountain View, California, will be more to its reputation than to its finances: the Nasdaq-traded firm took in $29.3bn in turnover in 2010.