Microsoft, Google and Yahoo have agreed to pay a total of $31.5m (£15.7m) to settle claims that they accepted online ads promoting illegal gambling.
Online gambling is illegal in the US but still widespread
None of the three firms have accepted any wrongdoing as part of the civil settlement, which concludes an investigation dating back to 2000.
The US authorities claimed the trio illegally accepted payments from online gaming firms between 1997 and 2007.
The companies said they stopped taking such adverts several years ago.
Under US federal law, online gambling on sports and casino games is illegal but the practice is still widespread with wagers worth about $6bn being struck every year.
As part of the settlement, Microsoft will pay a total of $21m although a third of this sum - $7.5m - will take the form of a charitable donation to support exploited children.
On top of a $4.5m forfeit, it will also fund a $9m three-year advertising campaign to alert young people to the illegality of online gambling.
Yahoo has agreed to forfeit $3m to the US authorities and will also fund a $4.5m advertising campaign warning its users that anyone participating in online sports gambling is liable to arrest and prosecution.
Google, meanwhile, has agreed to forfeit $3m.
Announcing the settlement, US Attorney for the eastern district of Missouri, Catherine Hanaway, said that "honest taxpayers and gambling industry personnel who do follow the law suffer from those who promote illegal online behaviour".
Microsoft said it stopped accepting online gambling ads four years ago, adding that the settlement reflected its "ongoing commitment to online safety".
Similarly, Yahoo said it had not accepted such ads for years, noting that it had co-operated with the authorities once it had been made clear of their concerns.
In a statement, Google said it had voluntarily stopped carrying such ads in April 2004.
The authorities' crackdown on online gambling has led to several high-profile prosecutions.
British firm BetOnSports pleaded guilty to racketeering charges earlier this year and cases are still pending against a number of its former executives.