A NEW law will be brought in so that the hundreds of innocent people sent to prison as a result of the Horizon Post Office scandal are “swiftly exonerated and compensated”, Rishi Sunak has said.

The announcement came at Prime Minister’s Questions on Wednesday, where Tory deputy chair Lee Anderson asked a question about the scandal aimed at LibDem leader Ed Davey.

“The Horizon Post Office scandal saw hundreds of innocent people sent to prison,” Anderson said.

“Now during this scandal the leader of the Liberal Democrats was the minister in charge of the Post Office.

“This is the same Liberal Democrat leader who in the past has called for the resignation of over 30 prominent people in this country who have made mistakes in their jobs.

“So does the Prime Minister agree with me that the leader of the LibDems should take his own advice and start by clearing his desk, clearing his diary, and clear off.”

Responding, Sunak said: “This is one of the greatest miscarriages of justice in our nation’s history.

“People who worked hard to serve their communities had their lives and their reputations destroyed through absolutely no fault of their own. The victims must get justice and compensation.”

Sunak said Wyn Williams, the chair of the inquiry into the Post Office scandal, was "undertaking crucial work" looking at what mistakes were made, and said that more than £150m in compensation had been paid to more than 2500 victims.

The Prime Minister went on: "Today I can announce that we will introduce new primary legislation to make sure that those convicted as a result of the Horizon scandal are swiftly exonerated and compensated."

He told MPs that Business Minister Kevin Hollinrake will set out “more details to the House shortly”.

He added: “We will make sure that the truth comes to light, we right the wrongs of the past, and the victims get the justice they deserve.”

READ MORE: Kate Forbes: MSPs doing Scots a 'disservice' by letting devolution be eroded

Davey has also faced calls to hand back his knighthood over his handling of the Post Office scandal, which has come to fresh prominence after an ITV dramatisation of the story.

Almost 1000 sub-postmasters were convicted of crimes including theft and embezzlement on the basis of evidence from a flawed IT system.

Labour leader Keir Starmer said the victims had been waiting "far too long for the truth, for justice, and for compensation".

The exchange at PMQs comes after Scotland's Crown Office and Procurator Fiscal Service (COPFS) said it had been made aware of issues with the Fujitsu-made Horizon system in 2013.

But a spokesperson for the prosecutors said the Post Office claimed the system would have no impact on legal cases.

READ MORE: SNP MP David Linden reacts after Labour MPs snub cost of living debate

Asked if the Crown Office chose not to look again at the convictions in Scotland relating to Horizon because of assurances from the Post Office and if it felt it had been misled, the service said on Wednesday that it could not provide a response.

The ongoing public inquiry into the scandal and appeals against convictions may hamper what the COPFS can make public.

The spokesperson said: “Retained records demonstrate that COPFS were first made aware of potential problems with the Horizon computer system in May 2013.

“However, we were told by the Post Office at that time that these potential problems did not impact on any of our cases.”

The COPFS also said it estimates up to 100 people were convicted in Scotland as a result of Horizon.