AT&T Inc., Verizon Communications Inc. and 10 other large phone companies have struck an agreement with 51 attorneys general to enact technology to block robocalls before they reach consumers.

The deal, announced last week, will help protect consumers from receiving illegal robocalls, and assist law enforcement in investigating and prosecuting bad actors, said North Carolina Attorney General Josh Stein, who is leading the effort that includes all 50 states and the District of Columbia.

Under the deal, the companies will launch the call-blocking technology at no cost to consumers, and make other free anti-robocall devices and apps available to subscribers.

"By signing on to these principles, industry leaders are taking new steps to keep your phone from ringing with an unwanted call," Stein said in a statement.

The companies are under pressure to protect consumers against the unwanted calls, which are a top source of complaints with the U.S. Federal Communications Commission.

Across the U.S. there were 48 billion robocalls last year, up from 31 billion in 2017, according to a tally by YouMail Inc., a developer of software that blocks the calls.

In July, AT&T, Verizon and T-Mobile US Inc. said they were making progress toward installing technology to authenticate calls so consumers would know whether the call is coming from the person supposedly making it. The FCC has demanded the technology be in place by the end of the year.

FCC Chairman Ajit Pai said the agreements with the states "align with the FCC's own anti-robocalling and spoofing efforts," including the agency's caller authentication standards.

"Few things can bring together policy leaders across the political spectrum like the fight against unwanted robocalls," Pai said in a statement. "The FCC is committed to working together with Congress, state leaders, and our federal partners to put an end to unwanted robocalls."

Consumers are often duped into answering phone calls because they appear to be from a local number or business.

"The bad actors running these deceptive operations will soon have one call left to make: to their lawyers," New York Attorney General Letitia James said in the statement.

The other companies signing the agreement are T-Mobile, CenturyLink Inc., Comcast Corp., Sprint Corp., Bandwidth Inc., Charter Communications Inc., Consolidated Communications Holdings Inc., Frontier Communications Corp., U.S. Cellular Corp. and Windstream Holdings Inc.

Several of the top U.S. carriers issued statements in concert with the state attorneys general announcement.

"The fight against the scourge of illegal robocalls requires all hands on deck, and we welcome and appreciate the support of the state attorneys general," AT&T said in a statement.