NORTH PROVIDENCE, R.I. — Two Rhode Island communities can use about $70 million forfeited by Google Inc. to fix their police pension shortfalls after the U.S. Department of Justice on Friday waived rules restricting how the money could be spent.

The news is a boon for the financially troubled city of East Providence and the town of North Providence, which face unfunded pension liabilities in the tens of millions of dollars.

Sen. Sheldon Whitehouse, who pushed U.S. Attorney General Eric Holder for the waiver, said using the money to relieve the pension burden was the highest and best use of the money.

“It is certainly a transformational financial moment,” Whitehouse said at a news conference. North Providence Mayor Charles Lombardi called it a monumental decision for both communities that would affect residents for years.

Police from those communities had helped a federal investigation into the search engine company’s distribution of ads for illegal prescription drug sales. Each community got a $60 million share when Google agreed to forfeit $500 million.

But rules prescribed how the money could be spent, leading to the waiver.