LONDON (Reuters) - Tullow Oil (>> Tullow Oil plc) said on Friday a London court had ruled in its favour in a case the oil company brought against Heritage Oil (>> Heritage Oil PLC) over tax payable on the sale of oil fields in Uganda.

"Mr. Justice Burton found in favour of Tullow's indemnity claim for $313 million in its entirety and also dismissed Heritage's counterclaim," Tullow said in a statement.

The legal battle dates back to 2010 when the Ugandan government demanded more than $400 million in capital gains tax after Heritage Oil (>> Heritage Oil PLC) sold assets in the east African country to Tullow in a $1.45 billion deal.

Heritage said in a separate statement it strongly disagreed with the decision and would now evaluate its legal options with a view to launching an appeal. It has 21 days to do so.

Tullow said it might be entitled to further payment from Heritage in costs and from the interest Heritage could owe Tullow on the $313 million. A further hearing would be scheduled to address these matters.

Heritage said the ruling would not impact its current cash position as the sum had already been reserved, partly in an escrow account and partly by a deposit with Uganda.

Tullow has brought in new partners France's Total (>> TOTAL) and China's CNOOC to Uganda and the three are planning a multi-billion dollar oil development.

When the original deal between Heritage and Tullow was concluded, Tullow paid the Ugandan Revenue Authority (URA) $121.5 million - a third of the original $405 million tax demand - and put the remaining $283.5 million into an escrow account.

In 2011, Tullow complied with another URA demand for a further $313.5 million payment, which included the balance of the original tax demand, plus an extra $30 million.

In afternoon trading, shares in Heritage, were down 2.6 percent at 138.5 pence, underperforming the European oil and gas company index <.SXEP> which was 0.5 percent higher. Tullow was up 1 percent at 1,044 pence. ($1 = 0.6377 British pounds)

(Editing by Rosalba O'Brien and Jane Merriman)

By Sarah Young

Stocks treated in this article : TOTAL, Heritage Oil PLC, Tullow Oil plc