This article was produced in partnership with the Charleston Gazette-Mail, which is a member of the ProPublica Local Reporting Network.

The second-largest natural gas producer in West Virginia will pay $53.5 million to settle a lawsuit that alleged the company was cheating thousands of state residents and businesses by shorting them on gas royalty payments, according to terms of the deal unsealed in court this week.

Pittsburgh-based EQT Corp. agreed to pay the money to end a federal class-action lawsuit, brought on behalf of about 9,000 people, which alleged that EQT wrongly deducted a variety of unacceptable charges from peoples’ royalty checks.

The deal is the latest in a series of settlements in cases that accused natural gas companies of engaging in such maneuvers to pocket a larger share of the profits from the boom in natural gas production in West Virginia.

This lawsuit was among the royalty cases highlighted last year in a joint examination by the Charleston Gazette-Mail and ProPublica that showed how West Virginia’s natural gas producers avoid paying royalties promised to thousands of residents and businesses. The plaintiffs said EQT was improperly deducting transporting and processing costs from their royalty payments. EQT said its royalty payment calculations were correct and fair.

The Daily Digest Get the latest news from ProPublica every afternoon.

A trial was scheduled to begin in November but was canceled after the parties reached the tentative settlement. Details of the settlement were unsealed Wednesday.

Under the settlement agreement, EQT Production Co. will pay the $53.5 million into a settlement fund. The company will also stop deducting those post-production costs from royalty payments.

“This was an opportunity to turn over a new leaf in our relationship with our West Virginia leaseholders and this mutually beneficial agreement demonstrates our renewed commitment to the state of West Virginia,” EQT’s CEO, Robert McNally, said in a prepared statement.

EQT is working to earn the trust of West Virginians and community leaders, he said.

Marvin Masters, the lead lawyer for the plaintiffs, called the settlement “encouraging” after six years of litigation. (Masters is among a group of investors who bought the Charleston Gazette-Mail last year.)

Funds will be distributed to people who leased the rights to natural gas beneath their land in West Virginia to EQT between Dec. 8, 2009, and Dec. 31, 2017. EQT will also pay up to $2 million in administrative fees to distribute the settlement.

Read More Century-Old West Virginia Leases Yield Paltry Gas Royalties. A Suit Could Cut Others’ Payouts to a Trickle, Too. Energy giant EQT is challenging a 36-year-old law that gives residents a bigger share of natural gas profits at a time when the industry is flourishing.

Settlement payments will be calculated based on such factors as the amount of gas produced and sold from each well, as well as how much was deducted from royalty payments. The number of people who submit claims could also affect settlement payments. Each member of the class that submits a claim will receive a minimum payment of at least $200. The settlement allows lawyers to collect up to one-third of the settlement, or roughly $18 million, subject to approval from the court.

The settlement is pending before U.S. District Judge John Preston Bailey in the Northern District of West Virginia. The judge gave it preliminary approval on Monday, which begins a process for public notice of the terms and a fairness hearing July 11 in Wheeling, West Virginia. Payments would not be made until that process is complete.

The Charleston Gazette-Mail and ProPublica want to tell the story of the changing landscape in West Virginia, and how coal and natural gas are impacting it. West Virginians: Tell us how your community is changing. Call or text us at 347-244-2134, or email us: [email protected]. Kate Mishkin and Ken Ward Jr. cover the environment, workplace safety and energy, with a focus on coal and natural gas for the Charleston Gazette-Mail. Email Kate at [email protected] and follow her on Twitter at @katemishkin; email Ken at [email protected] and follow him on Twitter at @kenwardjr.