WASHINGTON — Consumers just got new tools to combat robocallers as President Donald Trump signed legislation designed to address the problem.

The White House announced late Monday that Trump had signed the bill, a rare example of bipartisan cooperation in Congress. The measure had passed the House, 417-3, and cleared the Senate unanimously.

“This historic legislation will provide American consumers with even greater protection against annoying unsolicited robocalls,” White House spokeswoman Stephanie Grisham said in a statement.

“American families deserve control over their communications, and this legislation will update our laws and regulations to stiffen penalties, increase transparency, and enhance government collaboration to stop unwanted solicitation.”

The bill’s chief House sponsor was New Jersey Democratic Rep. Frank Pallone Jr.

“I’m delighted the President signed this overwhelmingly bipartisan bill into law," Pallone said. "It will bring much-needed relief to New Jerseyans who have put up with these relentless and illegal calls for far too long.”

It will require carriers to offer call-authentication technology and to enable their customers to block robocalls at no additional charge.

The bill also gives the Federal Communications Commission more time to go after robocallers and impose higher fines on those who break the law. It will also help the FCC and phone companies discover which firms are responsible for large numbers of robocalls, and provides protections for doctors, hospitals and patients, whose phones can be inundated by such calls.

There were 5 billion illegal robocalls in November, including 136.6 million in New Jersey, an average of 13.4 per person, according to YouMail’s Robocall Index.

In addition to the annoyance of discovering a recorded message at the other end of the line, robocalls also are used to rip off unsuspecting consumers. Pallone has said such scams cost 22 million Americans $9.5 billion in 2016.

The problem was so pervasive that when U.S. Sen. Robert Menendez, D-N.J., held a press conference in April to call attention to the legislation, he was interrupted by a robocall.

“If there’s one thing that unites us all, it’s the shared hatred of those annoying, disruptive and illegal robocalls," Menendez said Tuesday. "This is about giving people some peace of mind, restoring faith that the next time the phone rings, it’s a real person at the other end they might actually want to to talk to, and improving their overall quality of life.”

Jonathan D. Salant may be reached at jsalant@njadvancemedia.com. Follow him on Twitter @JDSalant or on Facebook. Find NJ.com Politics on Facebook.

Have a tip? Tell us. nj.com/tips.

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.