Whitefish Energy Holdings claims the Puerto Rico Electric Power Authority withheld the money at the request of Indiana-based Arc American Inc.
The northwest Montana company asked U.S. District Judge Dana Christensen in a lawsuit filed this week to force Arc to withdraw the request so Whitefish can be paid.
In a Nov. 16 letter to the power authority, Arc American president Ben Wilson said Whitefish had failed to pay it $8.7 million for work done by the subcontractor. Wilson asked the authority to pay Arc American directly instead of through Whitefish.
Whitefish's contract expired Thursday after accusations of overcharging that also contributed to the resignation of the power authority's director.
The company has defended its work as effective in restoring power to large areas after Hurricane Maria battered the island on September 20. Spokesman Ken Luce said Friday that hundreds of Whitefish workers and their equipment will now return to the U.S. mainland.
"We finished a lot of work in the last couple of weeks," Luce said. The company said Wednesday it had completed repairs to a major transmission line that would allow power to be restored to many San Juan neighborhoods.
He added that criticism of the $300 million contract "seems to be more of a U.S. issue than a Puerto Rico issue" and that the people on the island had been appreciative of the company's work.
Whitefish first came under scrutiny because it's based in the same small Montana town - also named Whitefish - as U.S. Interior Secretary Ryan Zinke.
Its contract was cancelled by Puerto Rico Gov. Ricardo Rossello after the Federal Emergency Management Agency said it had "significant concerns" about the deal. Hearings before Congress revealed that the power authority ignored advice from its own lawyers before signing the contract with Whitefish, which had just two employees when Hurricane Maria hit.
Many people in Puerto Rico remain without power more than two months after Category 4 Maria devastated the island, killing at least 55 people and causing damage estimated at up to $95 billion.
As of Wednesday, power had been restored to just over 61 percent of the island, the company said.
CEO Andy Techmanski said last month that Puerto Rico's government owed Whitefish more than $83 million, prompting it to temporarily halt work until it received a payment a few days later.
Luce, the company spokesman, declined to reveal the amount of that payment and described it as a "good will gesture" on the part of the power authority. He said the authority still owes Whitefish money, but would not say how much.
Whitefish was one of only two companies that offered immediate services after Hurricane Maria destroyed Puerto Rico's power grid, according to the power authority's former director, Ricardo Ramos, who resigned Nov. 17.
The other company required a guaranteed payment of $25 million - money that Ramos said the bankrupt utility with a $9 billion debt load did not have.
Follow Matthew Brown on Twitter at www.twitter.com/matthewbrownap .
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.