Image caption The former boss of HMRC, Dave Hartnett, struck a tax deal with Goldman Sachs

Dave Hartnett, the former head of HMRC who was criticised for "sweetheart deals" with big firms, has become a consultant to tax firm Deloitte.

A spokesperson for Deloitte said he would be advising foreign governments and tax administrations, primarily in the developing world.

Deloitte, whose clients include Starbucks, said Mr Hartnett would work one day a week for it.

It added that he would not work with UK companies or HMRC.

Mr Hartnett was permanent secretary at the UK's tax body until last summer. His appointment comes weeks after his deal with Goldman Sachs was tested in court.

Legal challenge

The agreement with Goldman Sachs included the waiving of interest payments on unpaid National Insurance contributions.

Subsequently HMRC admitted it had made a mistake, and said it should have collected up to £8m that was owed by the bank, although it insisted it was "a good settlement".

The claim that the taxpayer received good value from the deal was also supported by a report from the National Audit Office published in June 2012.

However, the deal was challenged in the High Court by the pressure group UK Uncut Legal Action.

A judge ruled that HMRC had acted lawfully, but added it had not been HMRC's most "glorious episode".

Mr Hartnett was also in charge at HMRC when it had to send out millions of tax letters correcting over and under payments.

He initially told the BBC at the time that he saw no need to apologise for the mistake, although he subsequently did make an apology to those affected.

Earlier this year, Mr Hartnett also took a part-time role as an adviser to banking giant HSBC.