The First Minister has apologised to farmers at the Royal Highland Show after it was confirmed her administration may miss the deadline to hand out EU agricultural subsidies for the second year in a row.

If the deadline is missed then the devolved government may be liable for a multi-million pound fine from the EU, on top of the one it could already face after last year's delays.

Applications are processed and paid through an £178m IT programme which has been fraught with problems since its inception.

Nicola Sturgeon's visit to the agricultural event came just a day after EU Commission sources told STV News that the Scottish Government had requested a four-month extension to the Common Agricultural Policy (CAP) payment deadline.

Earlier on Thursday the SNP leader refused to confirm at First Minister's Questions if the approach had been made but her spokesman later announced it had taken place two days earlier.

Sturgeon told farmers: "We have made a clear commitment to do all we can to make the 2016 pillar one payments by the end of next week, the set payment period, although we have discussed the contingency of an extension to that with the European Commission.

"At present we've made more than £249m of these payments and of course farmers have been given access to loans pending the delivery of their actual payments.

"We are making significant progress now on payments and on resolving the remaining IT issues in the system.

"I want to assure you today... there's no complacency on the Scottish Government's part about this matter.

"We have already apologised and we do so again today to farmers for the failures that have been experienced in the system and I guarantee that we will continue to give this matter our full focus and attention to ensure that farmers get the service that they deserve."

The Scottish Conservatives have accused the First Minister of treating Holyrood with contempt and that rural economy secretary Fergus Ewing should consider his position.

Tory MSP Finlay Carson said: "Nicola Sturgeon and Fergus Ewing have some very serious questions to answer. "We now know that earlier this week, they went cap in hand to the European Commission to plea for the payment deadline to be extended.

"But, when confronted in parliament over whether they had done, they ducked and dived and avoided the question."