Verizon and Sprint are paying the government millions of dollars to settle accusations that the two companies slipped unwanted third-party charges onto consumers' wireless bills.

Until last year, the Federal Communications Commission said, Verizon and Sprint charged thousands of customers monthly fees for services such as ringtone subscriptions, horoscope text messages and flirting tips they didn't sign up for. These services are known in the industry as "premium" SMS services.

Verizon and Sprint took a cut of more than 30 percent of every charge, according to the FCC. To settle the accusations by the FCC, the Consumer Financial Protection Bureau and state governments, Verizon will pay $90 million, while Sprint will pay $68 million. The companies will no longer be allowed to offer the spammy subscription services, and they will be required to get their customers' permission before charging any third-party fees at all.

"For too long, consumers have been charged on their phone bills for things they did not buy,” FCC Chairman Tom Wheeler said in a statement. “We call these fraudulent charges ‘cramming,’ and with today’s agreements we are calling them history for Verizon and Sprint customers.”

Sprint and Verizon customers who may have been hit with cramming charges can request refunds that will take up the lion's share of the two companies' settlement funds. State governments will receive a total of $28 million, and $10 million will go to the U.S. Treasury.

"Sprint has always put its customers’ interests first, and, under its liberal … refund policy, returned tens of millions of dollars long before the government initiated its investigation of our industry," Sprint said in a statement.

Verizon said it had "rigorously protected" consumers from bogus charges by vetting the premium SMS firms and "terminat[ing] providers who did not comply with our industry-leading practices.

Cramming has been the subject of multiple federal probes. AT&T and T-Mobile have both been dinged by the government for engaging in the practice. Now, with the addition of Verizon and Sprint, all four national carriers have been given a slap on the wrist.

The settlement comes at an interesting time for Verizon, on the day that it announced it was seeking to acquire AOL for $4.4 billion.