PROVIDENCE, R.I. (AP) -- Two Rhode Island communities will be allowed to use about $70 million forfeited by Google (NASDAQ:GOOGL) to fix their police pension shortfalls, The Associated Press has learned.

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.

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 it for pension shortfalls. Seth Larson, a spokesman for Sen. Sheldon Whitehouse, told the AP on Friday that the DOJ granted the requests.

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 fund shortfall for firefighters and police officers has an unfunded liability of about $65 million, according to the most recent numbers available from the state.

The Motley Fool recommends Google. The Motley Fool owns shares of Google. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.