Two Rhode Island communities will be allowed to use about $70 million forfeited by Google Inc. to fix their police pension shortfalls.

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.

"This is monumental to the financial stability of both communities," said North Providence Mayor Charles Lombardi.

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, restricting it to uses such as law enforcement investigations, training and equipment. The communities asked the U.S. Department of Justice to waive those rules and instead allow them to use the money for pension shortfalls. The DOJ decided to grant the requests, according to U.S. Sen. Sheldon Whitehouse, in what Whitehouse said U.S. Attorney General Eric Holder termed "an extraordinary exception to the customary rules."

East Providence will be allowed to use $49.2 million, while North Providence may use $20.6 million, he said.

In North Providence, the pension has a shortfall of $20 million to $22 million and funding ratio of 42 to 44 percent, said G. Richard Fossa, the mayor's chief of staff.

"This won't fully fund it, but very close to it. We'll be 95 or 98 percent funded," Fossa said.

East Providence, a city of 47,000 residents, was placed under state fiscal oversight in 2011 after its bond rating was downgraded to below investment grade and because of budget deficits. The city's pension system is only about 33 percent funded, with a liability of $105.8 million, according to state Revenue Director Rosemary Gallogly.

East Providence's share of the money will cut the liability nearly in half — meaning the pension system will be nearly 60 percent funded.

"It is certainly a transformational financial moment," Whitehouse said of the impact the funds will have on the cities' fiscal health.