The Government lost over a million pounds on a Ministry of Justice commercial venture that was due to run the Saudi Arabian prison system, an investigation has found.

The National Audit Office, the Government’s spending watchdog, said that Just Solutions International (JSi) had costs of £2.1 million and generated an income of £1 million its existence.

JSi, the trading face of the Ministry of Justice, was set up by civil servants in 2012 to bid for commercial contracts abroad using UK state expertise.

In Autumn 2015 Michael Gove, the newly appointed Justice Secretary, wound up the venture and pulled out of contracts in countries with poor human rights records – Saudi Arabia and Oman.

The policy had been instituted by Mr Gove’s predecessor Chris Grayling. Mr Gove has also cancelled a number of other policies predating his time at the MoJ, including a ban on prisoners being sent books and further cuts to legal aid than those already implemented.

The loss was partly generated because of the decision to terminate the £5.9m deal, the NAO said.

“The NAO estimate that JSi’s costs were approximately £2.1 million from 2012 until its closure, including £239,000 on consultancy services. Therefore JSi made a net loss of approximately £1.1 million in this period,” the office said in a summary of its report.

“This is due, in part, to the decision to withdraw from prospective arrangements with Saudi Arabia and Oman.

“The NAO also note that had JSi not been created, NOMS would have committed funding to support wider international engagement with countries to support FCO and wider Government objectives.”

Michael Gove cancelled the contract (Getty)

The decision about whether to scrap the contract was reported to be controversial within the Cabinet.

The Foreign Office in particular was said to be worried that cancelling such a contract would have wider diplomatic ramifications for Britain’s relationship with the country.

Foreign Secretary Phillip Hammond is said to have accused Mr Gove of naivety for his opposition to the contract, leading to a “robust exchange of views” between the two ministers.

Speaking in the House of Commons, Mr Gove played down his role, stressing that the contract had been dropped as part a cross-government review, adding that MoJ resources should be targeted at domestic prison reform.

Amnesty International UK’s Government and Political Relations Manager Lucy Wake said: “On top of the apparent waste of money, there are a still a host of unanswered questions about this ill-fated project.

“It was never clear what human rights safeguards or training were ever going to be built into this murky deal - for example would UK contractors have been actively trying to challenge and prevent human rights violations in countries with notoriously abusive justice systems, not least in Saudi Arabia?

10 examples of Saudi Arabia's human rights abuses Show all 10 1 /10 10 examples of Saudi Arabia's human rights abuses 10 examples of Saudi Arabia's human rights abuses In October 2014, three lawyers, Dr Abdulrahman al-Subaihi, Bander al-Nogaithan and Abdulrahman al-Rumaih , were sentenced to up to eight years in prison for using Twitter to criticize the Ministry of Justice. AFP/Getty Images 10 examples of Saudi Arabia's human rights abuses In March 2015, Yemen’s Sunni President Abd-Rabbu Mansour Hadi was forced into exile after a Shia-led insurgency. A Saudi Arabia-led coalition has responded with air strikes in order to reinstate Mr Hadi. It has since been accused of committing war crimes in the country. Getty Images 10 examples of Saudi Arabia's human rights abuses Women who supported the Women2Drive campaign, launched in 2011 to challenge the ban on women driving vehicles, faced harassment and intimidation by the authorities. The government warned that women drivers would face arrest. Getty Images 10 examples of Saudi Arabia's human rights abuses Members of the Kingdom’s Shia minority, most of whom live in the oil-rich Eastern Province, continue to face discrimination that limits their access to government services and employment. Activists have received death sentences or long prison terms for their alleged participation in protests in 2011 and 2012. Getty Images 10 examples of Saudi Arabia's human rights abuses All public gatherings are prohibited under an order issued by the Interior Ministry in 2011. Those defy the ban face arrest, prosecution and imprisonment on charges such as “inciting people against the authorities”. Getty Images 10 examples of Saudi Arabia's human rights abuses In March 2014, the Interior Ministry stated that authorities had deported over 370,000 foreign migrants and that 18,000 others were in detention. Thousands of workers were returned to Somalia and other states where they were at risk of human rights abuses, with large numbers also returned to Yemen, in order to open more jobs to Saudi Arabians. Many migrants reported that prior to their deportation they had been packed into overcrowded makeshift detention facilities where they received little food and water and were abused by guards. Getty Images 10 examples of Saudi Arabia's human rights abuses The Saudi Arabian authorities continue to deny access to independent human rights organisations like Amnesty International, and they have been known to take punitive action, including through the courts, against activists and family members of victims who contact Amnesty. Getty Images 10 examples of Saudi Arabia's human rights abuses Raif Badawi was sentenced to 1000 lashes and 10 years in prison for using his liberal blog to criticise Saudi Arabia’s clerics. He has already received 50 lashes, which have reportedly left him in poor health. Carsten Koall/Getty Images 10 examples of Saudi Arabia's human rights abuses Dawood al-Marhoon was arrested aged 17 for participating in an anti-government protest. After refusing to spy on his fellow protestors, he was tortured and forced to sign a blank document that would later contain his ‘confession’. At Dawood’s trial, the prosecution requested death by crucifixion while refusing him a lawyer. Getty Images 10 examples of Saudi Arabia's human rights abuses Ali Mohammed al-Nimr was arrested in 2012 aged either 16 or 17 for participating in protests during the Arab spring. His sentence includes beheading and crucifixion. The international community has spoken out against the punishment and has called on Saudi Arabia to stop. He is the nephew of a prominent government dissident. Getty

“It’s worrying that ministers appeared to go largely under the radar to set the project it up, even at a time of huge public concern at the UK’s overly-cosy relationship with Saudi Arabia.

“When details began to trickle out, the UK government was still trying to defend the project even after the blogger Raif Badawi was taken out of a Saudi prison cell and publicly flogged and even as the Saudi authorities carried out dozens of executions.

“The last thing the UK should ever have been doing was trying to make money out of overseas justice systems that tolerate secret detention, torture, corporal punishment and executions.”

Announcing the decision to drop the bid last year, the Prime Minister’s official spokeswoman said:

“This bid to provide the additional training to Saudi Arabia has been reviewed and the government has decided that it won’t be proceeding with the bid.

“The review has been on-going following the decision that was announced earlier in September to close down the Just Solutions International branch of the Ministry of Justice that was providing some of these services.”

“We will continue to engage and work with the Saudis on human rights issues, political reform and will continue to raise concerns where we have them.”

Labour leader Jeremy Corbyn said Mr Cameron had been “shamed” into a U-turn.

“Why on earth was it set up in the first place? We should be sending a strong message to repressive regimes that the UK is a beacon for human rights and that this contract bid is unacceptable in the 21st century, and would damage Britain's standing in the world,” he said.

The Saudi Arabian justice system makes routine use of crucifixion, beheadings, and lashes.

Amnesty International says the country has executed 175 people over the last year. Crimes punishable by death under Saudi’s penal code include adultery.

Despite the about-face on the prisons contract, the UK still sells billions of pounds worth of arms to Saudi Arabia.

Between May 2010 and May 2015 the Coalition government licenced almost £4bn in arms to the regime, according to figures obtained by the Campaign Against the Arms Trade.