Neil M. Barofsky, whose aggressive oversight of the government’s $700 billion bank bailout program has become a thorn in the Obama administration’s side over the past two years, gave notice Monday that he plans to resign his position at the end of March.

In a 1,000-word resignation letter to President Obama, Barofsky said that his work as special inspector general for the Troubled Assets Relief Program had “helped quench American taxpayers’ thirst for information on the expenditure of their tax dollars through TARP” and that the program “stands in a far better and more transparent place today than anyone could have reasonably hoped” in late 2008.

Barofsky, a former assistant U.S. attorney for the Southern District of New York who had prosecuted everyone from multibillion-dollar accounting frauds to South American drug lords, was nominated to the post by President George W. Bush in November 2008 and confirmed by the Senate the following month.

He quickly emerged as an aggressive overseer, viewed as a much-needed cop monitoring for waste and fraud within TARP by some lawmakers and watchdog groups, and, by Treasury officials and financial-industry representatives, as a self-promoter whose overreaching investigations scared some needy banks away from participating in the federal aid program.

In his sometimes scathing reports to Congress, Barofsky showed little reluctance in criticizing administration officials on everything from how their lack of transparency was fueling “anger, cynicism and distrust” to how their foreclosure prevention efforts had fallen well below expectations.

Barofsky was particularly hard on the government’s bailout of insurance giant American International Group, saying that the Federal Reserve Bank of New York — which was led at the time by now-Treasury Secretary Timothy F. Geithner — “refused to use its considerable leverage” and instead paid AIG’s trading partners in full on the firm’s debts. A later report also accused Treasury of being far too optimistic in its projections that the massive AIG bailout could cost far less than anticipated.

Such criticisms did not sit well with Treasury officials, many of whom believed Barofsky’s conclusions were overstated and aimed primarily at drawing media attention.

“We’re fine with critics,” said one Treasury official, who spoke on condition of anonymity in order to speak more candidly. “[But] he’s been consistently wrong about a lot of big things.”

On a day when federal spending cuts were in the spotlight, Barofsky boasted that his oversight operation had grown into “a flourishing independent office” with more than 140 auditors, investigators and attorneys based in Washington, New York, San Francisco and Atlanta. Even as the TARP program winds down, he said, overseeing the program “remains vitally important.” Barofsky noted that his office has 140 ongoing investigations and “is poised to broaden its impact even further and to bring scores of additional defendants to justice for their attempts to take criminal advantage of the nation’s financial crisis.”

Barofsky declined a request for an interview. But a spokeswoman said that his resignation “was a personal decision based on a number of factors, including his desire to spend more time with his wife and 9-month-old daughter” and also “because he believes that he has achieved the goals he set for this office when he took his oath.”

Members of both parties on Capitol Hill praised Barofsky’s efforts Monday.

“No one has been more dedicated to protecting the American people’s tax-dollars from waste, fraud and abuse,” Darrell Issa (R-Calif.), the chairman of the House Committee on Oversight and Government Reform, said in a statement. “It is imperative that the next IG pick up immediately where Mr. Barofsky left off.”

That much is true, at least in certain corners of the Treasury, where news of Barofsky’s departure brought a touch of delight Monday.

“It was,” said one official, “like a nice valentine to us.”