A former tax chief accused of overseeing sweetheart deals that let big companies off millions of pounds in tax has found a new role – protecting HSBC from dealing with tax cheats.

David Hartnett, the former chief executive of HM Revenue & Customs, is to join a committee of the great and the good set up to advise the bank on how to avoid getting entangled with tax evaders, terrorists and drug dealers.

It follows the $1.9bn (£1.2bn) fine the bank was forced to pay to United States watchdogs for breaching rules on money laundering that allowed the bank to be used as a conduit for a river of money from drug cartels.

Download the new Independent Premium app Sharing the full story, not just the headlines

But the move has outraged tax campaigners. Mr Hartnett was publicly humiliated by Margaret Hodge, chairman of the House of Commons Public Accounts Committee, over a deal which let Goldman Sachs off £10m in tax.

The National Audit Office later said that the deal, and those with other companies, were reasonable, but criticised HMRC for a failure to seek proper legal advice, involve specialists or even take notes during negotiations with big companies.

Mr Hartnett, who retired last summer, will be required to work for between 35 and 40 days a year. His pay is not being disclosed, but such advisory roles typically carry lucrative fees, and could easily net a six-figure sum.

The Goldman Sachs deal is being challenged in the courts by UK Uncut Legal Action, the tax pressure group. a spokesman for UK Uncut said: "It is not a great surprise that this man has found a job with big business after he had been friends for so many years with big business."

The spokesman said this was evidenced by "the secret deals that are now coming to light with the UK government letting some of the largest companies off from paying millions of pounds in tax.

"It is an enormous irony that this man, who has landed government in court as a result of a sweetheart deal on tax, is now advising one of UK's biggest banks on how to steer clear of trouble."

Sources close to HSBC said Mr Hartnett had been chosen as a result of his knowledge about tax.