PROVIDENCE, R.I. (AP) -- Two Rhode Island communities will be allowed to use about $70 million forfeited by Google (GOOGL -1.97%) 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.