A local contractor owes the developer of a controversial Cushing subdivision — that ended up in foreclosure — more than $513,000 for over-payments and some deficient work, a judge has ruled.

Justice Jeffrey Hjelm issued his order May 31 in a civil dispute between Cushing Holdings LLC and Last Resort Holdings LLC against D.L. Overlock Excavation. The state judge ruled that the Cushing developer — of which James Tower is the principal member — was owed $513,712 plus interest.

Overlock was hired by Tower to build roads in the subdivisions in Cushing. The work was done from 2004 through 2006.

Overlock initially filed a lawsuit against Cushing Holdings in 2006, arguing that he was owed more money under terms of an agreement. Cushing Holdings filed a counterclaim saying it overpaid Overlock and that the quality of the work was defective.

Justice Hjelm sided with Cushing Holdings on various points based on a hearing held in the case. The case focused on terms of an agreement and whether the contractor was to be paid based on flat fees or time worked. The judge also ruled that Overlock could not substantiate his claims of money owed to him.

Machias Savings Bank foreclosed on Tower’s unsold properties along the Meduncook River in 2008.

The 57-lot development had been a source of controversy in Cushing for years. Tower was fined by the town for cutting trees in a shoreland zone and ordered to re-plant trees.