AT&T will provide a free robocall-blocking service to mobile customers. Well, sort of free.

The free portion of the service will alert customers that a call is a suspected spam call, and from there consumers can manually block the call or send it to voicemail.

An automatic spam-blocking service that sends robocalls immediately to voicemail will cost $4 a month.

AT&T is rolling out a free robocall-blocking service to its mobile customers, becoming the first major wireless company to automatically block spam phone calls. But customers who want all the bells and whistles, including the ability to automatically send all robocalls directly to voicemail, will need to pay $4 a month.

The new service comes after a June ruling from the U.S. Federal Communications Commission permitted phone companies to offer robocall-blocking services on an "opt-out" basis. That allowed AT&T to roll out the service to all customers rather than requiring them to take the time to "opt in" to call blocking, the company said in a statement.

The free service automatically blocks suspected fraud calls, such as calls from fraudsters claiming they are from the IRS and demanding money. But robocalls, such as telemarketers calling to sell medical equipment, are flagged in the free version, and consumers then can manually block the caller or send the call to voicemail.

Get Breaking News Delivered to Your Inbox

The service with the most protection, which automatically sends suspected robocalls to voicemail, will cost $4 a month, as noted by Ars Technica.

While the federal agency allowed wireless phone companies to offer the service, it didn't require them to offer them for free. Robocalls have become a major nuisance for Americans, who received 25.3 billion -- with a b -- spam calls in the first six months of 2019 alone, according to a recent study from spam-monitoring service Hiya. That's more than double the amount of robocalls from just one year ago, Hiya found.

Robocalls come with real costs for consumers, including the risks of getting scammed by fraudsters. In other cases, consumers might not answer a valid call because they don't recognize the number, potentially missing an important call from their doctor or child's school, Hiya noted.

The free service will be added to millions of AT&T customer accounts over the next few months, AT&T said.