WASHINGTON — President Obama announced Wednesday night that the acting commissioner of the Internal Revenue Service had been ousted after disclosures that the agency gave special scrutiny to conservative groups. Attorney General Eric H. Holder Jr., meanwhile, warned top I.R.S. officials that a Justice Department inquiry would examine any false statements to see if they constituted a crime.

Speaking in the White House’s formal East Room, Mr. Obama said Treasury Secretary Jacob J. Lew had asked for and accepted the resignation of the acting commissioner, Steven Miller, who as deputy commissioner was aware of the agency’s efforts to demand more information from conservative groups seeking tax-exempt status in early 2012.

“Americans have a right to be angry about it, and I’m angry about it,” Mr. Obama said. “It should not matter what political stripe you’re from. The fact of the matter is the I.R.S. has to operate with absolute integrity.”

Mr. Miller, who told agency employees that he would leave the administration in early June, is scheduled to testify Friday before the House Ways and Means Committee in the first of a series of hearings on the I.R.S. activities.