The mayor of bankrupt Central Falls, R.I., resigned Wednesday after agreeing to a guilty plea on federal corruption charges, according to The Associated Press (AP). Charles Moreau pleaded guilty to accepting gifts in exchange for handing out lucrative contracts to board up foreclosed houses in the struggling city.

Moreau resigned as mayor effective noon Wednesday. A few hours later, federal prosecutors charged him with fraud and filed his plea deal with the U.S. District Court in Rhode Island.

The plea agreement comes after a two-year investigation that haunted the city of about 19,000 residents even as it struggled through bankruptcy. On Sept. 6, a little over a year after Central Falls filed for Chapter 9 bankruptcy protection, a federal judge approved the city’s five-year plan to close a $27 million budget gap.

In his plea agreement, Moreau acknowledged that as foreclosures in the city began to surge, he used his emergency powers to direct all of the boardup work to the company of his long-time friend and political contributor, Michael Bouthillette, who also pleaded guilty. Court papers say Bouthillette made “unreasonable profits” of hundreds of thousands of dollars, even re-boarding homes that other companies had already boarded up or where people were still living.

Moreau acknowledged that Bouthillette paid at least part of the cost for installing a furnace at his former Central Falls home and for renovations at another home Moreau owned. The total value of the gifts is estimated at $5,000 to $10,000, according to AP.

Prosecutors said they will recommend prison time for both men. They are expected to appear in court within a few days.

Moreau and other local elected leaders were stripped of power when a state-appointed receiver put the city into bankruptcy in August 2011. Elected officials could regain control as early as January, but only if they certify they are following the financial plan approved by the court.