The outgoing head of the IRS told Congress Friday that the US tax agency made "foolish mistakes" in targeting conservative groups but insisted the action was not politically motivated.

Lawmakers hammered Steven Miller, who resigned this week at the request of President Barack Obama, over abuse of power at the agency that Democrats and Republicans alike criticized as outrageous and unacceptable.

The Internal Revenue Service acknowledged last week that in 2010 employees subjected conservative groups, including those with "Tea Party" and "Patriots" in their names, to increased scrutiny when they applied for non-profit status.

"I want to apologize on behalf of the Internal Revenue Service for the mistakes that we've made and the poor service we provided," Miller told a tense hearing at the House Ways and Means Committee.

Stressing that "even the perception of partisanship has no place at the IRS," Miller said: "I do not believe that partisanship motivated the people who engaged in the practices described" in an internal report on the abuse.

"Foolish mistakes were made by people trying to be more efficient in their workload selection."

Miller faced intense questioning from lawmakers, including Republican committee chairman Dave Camp, who was angry that the IRS never told Congress that top officials, including Miller, knew about the abuse in May 2012.

"In fact, we were repeatedly told no such targeting was happening," Camp told Miller. "That isn't being misleading, that is lying."

Camp demanded that Miller tell Congress "who started the targeting, who knew, when did they know, and how high did it go?"

Obama said Thursday he had no prior knowledge of the abuse, and Miller told the hearing he "absolutely" did not contact the White House when he first learned of the burdensome scrutiny of the conservative groups last May.

Some Republicans have seized on the scandal -- coupled with the revelation that the Justice Department secretly seized several journalists' phone records -- as an example of big-brother government run amok.

And they are probing possible links to the White House, in a bid to draw the Democratic president into the controversy.

Lawmakers like Republican Kevin Brady demanded to know who exactly who was responsible for wrongdoing, but Miller was not forthcoming, saying: "I don't have names for you, Mr. Brady."

And, while he acknowledged the excess scrutiny was "inappropriate," he stressed that: "It's my belief that what happened here wasn't illegal."

Congressional fury was bipartisan.

The committee's top Democrat, Sander Levin, called for the resignation of Lois Lerner, the senior IRS official who acknowledged the wrongdoing a week ago, days after telling a congressional committee nothing of the abuse.

Miller described a process of "triage" in dealing with 70,000 applications for non-profit status that flooded in after the Supreme Court ruled in 2010 it is legal for companies or organizations to spend money on political activity.

The under-staffed department tasked with studying the applications began "centralizing" the groups, Miller said.

While he criticized the methods with which the screening was applied, he defended the scrutiny, saying "politics is an area where we always asked more questions, as we are obligated by law to do."

According to the Treasury's inspector general for tax Russell George, 298 cases were set aside for extra scrutiny, which led to "substantial delays."

Miller said that of those, 70 had "Tea Party" in their name. Asked if they were treated differently, Miller simply said "no."

And seething Democrat veteran Charles Rangel said the IRS's integrity, as well as that of the president and the administration, was on the line.

"People are losing confidence in our government," he told Miller, "and I hope that you feel the same sense to find out what caused this... and help us to restore the confidence that Americans should have in their government."