The security firm that transfers prisoners to courts has been late on nearly 22,000 occasions since taking over the contract at the start of the year.

Between January 10 and September, G4S was late in bringing prisoners to court 21,735 times, resulting in financial penalties of £334,500, Scottish Prison Service figures show.

G4S is the firm which was at the centre of the London 2012 Olympics staffing fiasco, when Armed Forces had to be drafted in because the company failed to supply enough staff.

The figures were revealed by the Scottish Government in response to a written question from Labour. The party's justice spokesman, Lewis Macdonald, said: "These figures show just how shoddy the basic service being provided by G4S is. I'm relieved they are being hit in the pocket for their poor performance.

"Scottish Labour again calls on the Scottish Government to stop awarding contracts to the company until their performance can be shown to be much better than it is at present."

A Scottish Prison Service spokeswoman said: "The number of delays to court business as a result of late deliveries of prisoners to court in the past 11 months has been very small and there has been a significant improvement in delivery performance since the contract became operational in January."

A G4S spokesman said: "We have retrained staff and introduced new procedures and our client, the Scottish Court Service, has noted a significant improvement in performance."