An Aberdeenshire farmer has won a case at the UK Supreme Court to reclaim VAT payments of more than £1m.
Frank Smart, of Torphins, was in a lengthy legal battle with the HMRC involving farm subsidies.
Under EU regulations, farmers could trade in units of single farm payments for land they were not farming.
Mr Smart claimed he should not have paid VAT on a £7.7m transaction to buy more than 34,000 units. In a judgement, the Supreme Court agreed.
Justices Lord Reed, Lord Wilson, Lord Hodge, Lord Briggs and Lady Arden dismissed HMRC's challenge the farmer's claim to VAT paid on the purchase.
In delivering the ruling on behalf of the court, Lord Hodge said the matter involved "a rather enterprising arrangement" over farm subsidies.
The judges said Mr Smart was entitled to a deduction of VAT because he bought the units in support of current and planned economic activities.
Mr Smart owns and is sole director of farming business Frank A Smart & Son Ltd (FASL).
With his wife he also runs a farm near Torphins, which is leased to FASL.
Single farm payments were agricultural subsidies paid by the Scottish government between 2005 and 2014 to farmers who met the criteria.
When the scheme started, farmers were allocated initial units of entitlement to single farm payments, or SFPE.
SFPEs could be traded and a market in them "developed", according to the Supreme Court.
FASL "took advantage of the market" in SFPE units to accumulate a fund for the development of its business.
It spent about £7.7m between 2007 and 2012 on purchasing 34,377 SFPE units.
In this period FASL paid VAT on the SFPE units which it bought and sought to deduct or claim repayment of the VAT as input tax.
HMRC refused to allow FASL to deduct VAT more than a million pounds in its returns between December 2008 and June 2012.
FASL won an appeal against the HMRC, with Mr Smart arguing that the money claimed back would be used to pay off his company's overdraft and also invested in growing the business, including the development of a wind farm and purchasing other farms.
The HMRC lodged its own appeal but lost and the dispute went to the Supreme Court.