The UK is suing the EU - on behalf of the SNP - over fines from the bloc, which Scotland claims were too high.
This is the first time the UK has taken such legal action against the EU since Brexit.
The SNP can't take the EU to court themselves, as the fines were initially imposed on the UK as a whole.
The Scottish Government was fined £5.6 million after a 2020 audit revealed failures with how it was administering Common Agricultural Policy (CAP) payments to Scottish farmers.
The SNP, which has always taken a strong pro-EU stance, is arguing the fines should be reduced to £3.2 million
The SNP, which has always taken a strong pro-EU stance, is arguing the fines should be reduced to £3.2 million - a reduction of around £2.4 million.
The UK is able to challenge fines which occurred when it was still an EU member state.
The audit was conducted before the transition period came to an end in December 2020.
According to the provisions of the Brexit Withdrawal Agreement, the UK has jurisdiction to challenge the fines as if it was still an EU member state. This is because the audit was conducted before the end of the transition period.
Farming Minister Mark Spencer said: "This is another example of the bureaucratic nature of the Common Agricultural Policy – which disproportionately rewarded the largest landowners, holding back smaller farms and delivering little for food productivity or the environment."
He added: "This Government is backing British farmers.
"We’ve committed to maintaining the £3.7 billion UK annual farming budget and our new farming policies ensure sustainable food production and environmental protection go hand-in-hand, with something on offer for every type of farmer.'
A spokesperson for the Scottish Government said: “The legal action has been brought by the UK Government.