White House regulatory czar Cass Sunstein, an intellectual mentor to President Obama whose skeptical approach to rule-making frustated the president’s liberal allies, announced Friday he was leaving his post.

Sunstein will depart by the end of the month, officials said. He is returning to the job he left, a professorship at Harvard Law School. In addition, Sunstein will head a new Harvard program on “behavioral economics and public policy.”

Obama thanked Sunstein, whom he met on the faculty of the University of Chicago Law School, for balancing the costs of regulations with their benefits. White House officials also lauded Sunstein’s efforts to weed out or streamline old rules. They said he had saved at least $10 billion and millions of hours of paperwork.

“Cass has shown that it is possible to support economic growth without sacrificing health, safety, and the environment,” Obama said in a written statement.

Sunstein heads a relatively obscure agency, the Office of Information and Regulatory Affairs, which acts as a gatekeeper for new federal regulations.

In Washington’s wonkier circles, he also has become a symbol of a central contradiction of Obama’s White House. In seeking bipartisan common ground, the administration has often embraced policies that disappointed its friends — without disarming its enemies.

On Friday, this came from a supporter of Obama’s views on the environment:

“It’s a glorious day,” said Frank O’Donnell, of the group Clean Air Watch. “Sunstein has been a blot on the landscape.”

And from an Obama adversary:

“The Chamber has enjoyed a good working relationship with Cass Sunstein and we wish him well in his return to Harvard Law,” said a spokeswoman for the U.S. Chamber of Commerce. Despite its happiness with Sunstein, the agency has spent millions of dollars attacking the president's policies.

Sunstein is married to National Security Council senior director Samantha Power, who recently gave birth to their second child.

His departure comes at an awkward time, three months before the presidential election. Senior administration officials said Sunstein is leaving in large part because of his expanding family obligations, and because of new, broader opportunities offered to him at Harvard. Power will stay in her post when she returns from leave later this summer.

Boris Bershteyn, the budget office’s general counsel, will replace Sunstein as acting director. A White House spokeman said Sunstein was not available for comment Friday.

Scholars who study Obama say that Sunstein had a major influence on Obama’s view of government — stressing pragmatism over ideology.

Sunstein’s work emphasizes the importance of consensus, social equality and broad political participation in American democracy. These themes are often echoed in Obama’s speeches.

Also, as a member of the Harvard Law Review editorial board in 1989, Obama helped oversee the publication of one of Sunstein’s most important essays. Titled “Interpreting Statutes in the Regulatory State,” it argued that regulations are always open to interpretation based on “culture and context.”

When Obama took office, he gave Sunstein the power to put his theories into practice.

His office leads a final review of all new federal regulations. After the Environmental Protection Agency or the Food and Drug Administration has written and revised and taken comments on a new rule, Sunstein’s agency can slow it down, alter it or send it back — which in some instances kills it.

Under Sunstein, the agency has overseen new rules designed to implement the health-care law and put the first limits on greenhouse-gas pollution from cars and power plants.

And his agency has done an unexpected amount of slowing and stopping.

“It could have been far, far worse if Cass was not occupying that seat,” said Jay Timmons, president and chief executive of the National Association of Manufacturers, talking about the burden of new federal rules. “He made a tremendous contribution to trying to ensure that there was balance between the regulators and those who were being regulated.”

In his writings and speeches, Sunstein has cast himself as the White House equivalent of Billy Beane, the baseball executive depicted in the book and movie “Moneyball.”

Beane relied on cold statistics, not a scout’s subjective intuition, to evaluate players. Sunstein sought to do something similar.

“Regulatory systems need their own Billy Beanes,” Sunstein said in a speech to a conference in June, “carefully assessing what rules will do before the facts and testing them after the fact.”

Republicans and tea party groups — angry about Obama’s support for health-care reform and a failed effort to regulate greenhouse gases — have said the White House has indulged in too much regulation.

But, in a March op-ed in the Chicago Tribune, Sunstein himself said he was pleased with his results. He said that Obama’s administration had imposed fewer new rules in its first three years than George W. Bush’s administration had in the same amount of time.

And, he said, Obama’s rules have given the country far more benefit for the buck.

“The net benefits of regulations . . . exceeded $91 billion — 25 times the corresponding number in the Bush administration and more than eight times the corresponding number in the Clinton administration,” Sunstein wrote.

Staff writers Carol D. Leonnig, David Nakamura and Juliet Eilperin contributed to this report.