The U.S. Virgin Islands has filed a lawsuit against oil company Hess Corp. for more than $1 billion, alleging the firm abandoned a massive oil refinery it had pledged to run through 2022.

Within hours of the filing Monday, the Hess subsidiary that owns the refinery announced that it will file for Chapter 11 bankruptcy, allowing it to pursue the sale of the refinery for use as a simple storage facility — the outcome that the territory's government had sought to prevent.

The islands' complaint alleged a pattern of misconduct by executives at Hess, which operated with Venezuela's state-owned oil company what was once the world's largest refinery before closing it in 2012. It said Hess conspired to strip the facility's assets in order to leave the government with claims against a broke, polluted and inoperable refinery.

“This is not about a business disagreement. It is about Hess breaking the law,” said Kenneth Mapp, governor of the U.S. Virgin Islands.

The small territory's government will not pay to challenge Hess, a $15 billion company. Instead, the Washington law firm it hired, Cohen Milstein Sellers & Toll PLLC, will fund the lawsuit — and collect between 20 and 28 percent of any proceeds.

In an emailed response, Hess spokeswoman Lorrie Hecker said, “We believe this suit is wholly without merit.”

A separate announcement by HOVENSA LLC, the partially owned Hess subsidiary that owns the refinery, called the end of refining at the operation “unavoidable given HOVENSA's financial condition” and said that a bankruptcy filing and sale was the best option for the residents and government of the Virgin Islands.

The high-stakes legal dispute marks a low in Hess's nearly 50-year history in St. Croix, whose 51,000 residents account for nearly half the population of the U.S. Virgin Islands. With an economy once based on sugarcane and rum — and, earlier, slaves — the impoverished island proved welcoming when oilman Leon Hess first built a refinery on the island in 1965. The facility came at a significant environmental price: Hess built the refinery on the largest mangrove lagoon on St. Croix, and the mishandling of crude oil and its byproducts at the facility led to extensive contamination of the aquifer.

In return for its largesse, Hess ultimately received billions of dollars in tax breaks from the territorial government. The case focuses on the terms of those tax breaks, which included conditions to promote the establishment and operation of refining operations. Subsequent agreements included one that went into effect in 2002 and was to last two decades, according to the agreement.

Hess pulled in huge sums — more than $6.2 billion in tax breaks and other benefits by 1992 alone, according to a Government Accountability Office report from that year. In 1998, it sold a 50 percent stake in the refinery to Venezuela's state-owned oil company, Petroleos de Venezuela S.A., or PDVSA, for $625 million. After being transferred into a joint venture, the refinery spun off billions of dollars more to its owners, according to financial records.

The lawsuit said Hess and PDVSA entered into contracts that artificially boosted the cost of the Venezuelan crude it purchased and suppressed the cost of the petroleum products the refinery sent to Hess gas stations along the East Coast. Meanwhile, the Hess executives overseeing the refinery loaded it with debt, the lawsuit said.

By late in the last decade, the refinery was struggling amid competition from emerging markets and other factors. Hess also had a sizable environmental liability: The U.S. Environmental Protection Agency was working toward what would eventually be a $700 million settlement in 2011 requiring the refinery to upgrade its equipment to improve safety and reduce pollution.

For decades, the EPA has also overseen an effort remove a massive plume of leaked oil from beneath the refinery that threatens the island's groundwater. So far, the EPA said, the project has recovered more than 43 million gallons of spilled oil.

Frustrated Virgin Island officials said the EPA and other federal agencies never did enough to address Hess's responsibility.

“They would have acted differently had this been somewhere else,” said Terrence “Positive" Nelson, a six-term territorial senator. “We had four times the Exxon Valdez spilled into our largest aquifer, and the EPA turned a blind eye.”

After privately deciding to cease refinery operations and convert the facility to an oil storage terminal, Hess halted routine maintenance, the government's lawsuit says. Instead of negotiating with the government over its hope to convert the refinery to a storage facility, the suit alleges that Hess's decision to abruptly cease operating the refinery “create panic within the Government due to the ensuing economic crises.” The company provided the territorial government only a day's notice of its intent to shut down the refinery.

Even after the shutdown and mass layoffs, the islands and Hess continued talks to reopen or sell the company. But the lawsuit and intended bankruptcy filing suggest the negotiations recently broke down for good.

“They have held us hostage because of the jobs, threatening to leave if they didn't get what they want,” Nelson said. “The government basically gave them everything, and they left anyway.”

The Associated Press