The scandal has been one of several to rattle the White House in recent days.

In a short statement, Mr Obama said he would work with Congress in further investigations of the IRS matter.

He also said he had asked Mr Lew to begin implementing recommendations from a treasury department report on how the groups were treated.

In a farewell letter to colleagues, Mr Miller said there was "strong and immediate need to restore public trust" in the IRS.

'Who is going to jail?'

It was revealed earlier in the week that the IRS had used key words such as "tea party" and "patriot" to subject applications by conservative groups seeking tax-exempt status to extra scrutiny.

The Treasury Inspector General for Tax Administration (TIGTA) report found that senior IRS officials had told inspectors the decision to focus on Tea Party and other groups was not influenced by any individual or organisation outside the agency.

But it found managers had allowed "inappropriate criteria" to be developed and stay in place for more than 18 months, resulting in "substantial delays" in processing applications for tax-exempt status, and requests for "unnecessary information", such as lists of past and future donors.

On Wednesday, Mr Obama said the actions were "intolerable" and vowed to do everything in his power to ensure "nothing like this happens again".

Some Republicans, including two high profile governors, have called for a special prosecutor to investigate.

House Speaker John Boehner told reporters earlier on Wednesday: "My question is, who's going to jail over this scandal?"

Meanwhile, Attorney General Eric Holder said the FBI probe into the IRS conduct would be as wide as necessary.

At least three congressional panels are planning hearings, and Representative Darrell Issa said on Wednesday that he had asked five mid-level IRS employees be made available for questioning.