Sasol Ltd. won 6.2 billion rand ($341 million) in damages and interest from South Africa’s state-owned Transnet SOC Ltd. after years of litigation over oil-pipeline charges. Its shares jumped.

Sasol and TotalEnergies SE, which jointly own a refinery at Sasolburg in the north of the country, brought legal action more than a decade ago against charges by Transnet for the use of a pipeline that ferries crude from the port city of Durban. Total was awarded 2.13 billion rand plus interest, according to court documents.

“Transnet overcharged Sasol Oil for the conveyance of crude oil over a number of years,” Sasol said in a statement on Thursday. The damages award was decided in the High Court on June 18, it said.

The settlement is a setback for Transnet as it addresses a collapse in port and rail infrastructure that has curbed South Africa’s mineral exports and economic growth. The company is already in poor financial health and has sought a bailout from the government, though the state wants to see progress on its turnaround plan first.

Transnet plans to appeal the judgment, which has “enormous implications not only for the public purse but also for Transnet’s ability to discharge its obligations under the applicable legislation and its license conditions,” the company said in a statement.

Sasol shares surged as much as 4.5% and traded 2.3% stronger at 134.62 rand by 11:37 a.m. in Johannesburg. TotalEnergies’ stock was little changed.

The settlement amounts to a material 9.67 rand per share for Sasol, Morgan Stanley analysts Christopher Nicholson and Brian Morgan wrote in a note.

“Transnet’s current financial position brings into question whether Sasol will receive this amount and if so the timing thererof,” they said.