Larry Summers had faced an uproar of Democratic opposition in recent weeks. (Jerome Favre/Bloomberg)

Lawrence H. Summers, the former Treasury secretary and senior White House economic adviser, has withdrawn as a candidate for Federal Reserve chairman in a startling development that raises urgent questions about who will lead the central bank when Chairman Ben S. Bernanke steps down in four months.

Summers withdrew after an intense uproar among liberal Democrats, women’s groups and other advocacy organizations against his potential nomination — a highly unusual assault on the candidate who President Obama favored for the job.

Obama has said he is considering two other candidates for the post, Fed Vice Chairman Janet L. Yellen and former Fed vice chairman Don Kohn. But he was leaning toward picking Summers, people close to the White House say, and the economist’s decision to take his name out of the ring might lead Obama to pursue a wider range of candidates.

Summers helped Obama navigate the depths of the financial crisis and recession, providing a degree of support that Obama has told aides he deeply valued. No official, with the possible exception of former Treasury secretary Timothy F. Geithner, did more to influence the president’s response to the traumatic events he faced at the beginning of his term, which Obama plans to highlight this week as he marks the fifth anniversary of the financial crisis.

On Sunday, Summers telephoned the president to tell him he was withdrawing his name from consideration.

“It has been a privilege to work with you since the beginning of your Administration as you led the nation through a severe recession into a sustained economic recovery,” Summers wrote in a letter to the president.

He added: “This is a complex moment in our national life. I have reluctantly concluded that any possible confirmation process for me would be acrimonious and would not serve the interest of the Federal Reserve, the Administration, or ultimately, the interests of the nation’s ongoing economic recovery.”

Obama accepted Summers’s decision, lauding him and saying that he planned to continue to consult his former adviser.

“Larry was a critical member of my team as we faced down the worst economic crisis since the Great Depression, and it was in no small part because of his expertise, wisdom and leadership that we wrestled the economy back to growth and made the kind of progress we are seeing today,” Obama said. “I will always be grateful to Larry for his tireless work and service on behalf of his country.”

The decision marks a disappointing turn of events for the renowned economist, who had operated at the highest levels of academia and government. But he has been dogged by controversies. Summers has come under fire for his support for deregulating parts of the banking sector while he was Treasury secretary under President Bill Clinton. While president of Harvard University in 2005, he also sparked controversy for his comments on women’s aptitude in math and science.

People close to the White House said Summers faced not only a rebellion among liberal Democrats but also other challenges, including a debate over whether to launch a military strike against Syria that stretched out the Fed process and gave more time for opposition to build.

“It was just a perfect storm of bad timing,” said one person close to the White House, who requested anonymity in order to speak candidly about private deliberations. “It would have been absolute war, and the president would have had to spend all of his political capital. Larry decided not to drag him through it.”

The contest for Fed chairman had taken on the form of a political campaign this summer, as allies of Summers and Yellen advanced their cases in the news media — and in behind-the-scenes whispering campaigns.

A wide array of current and former Obama officials backed Summers, arguing that his crisis experience and economic prowess made him an exceptional candidate. Yellen’s supporters, meanwhile, noted that she has deep Fed experience and has been an architect of the central bank’s efforts to reduce unemployment.

The drama started after word of Summers’s candidacy first circulated early this summer — when most Fed watchers thought Yellen would be appointed.

Liberals on Capitol Hill, as well as a wide array of economists, erupted. They said he had a brusque personality that would be problematic at the Fed.

Summers’s allies took to the media, noting that he was an architect of the president’s push for tough financial regulations after the crisis and couldn’t be so difficult to work with if he had garnered the support of so many of his White House colleagues.

When questioned on Capitol Hill, Obama made many of the same points in defense of his former adviser. But given the heated opposition, Obama decided to announce publicly that he would wait until the fall to make a decision, hoping to buy time and cool tensions.

Some former administration officials say, in retrospect, that the White House got the strategy wrong. While the noise from Capitol Hill died down for a while — and Senate leadership privately told the White House it would do all it could to get Summers through — key voices in the opposition grew louder.

In the past week, Democratic Sens. Jon Tester (Mont.) and Sherrod Brown (Ohio), members of the banking committee, which would have had to endorse Summers, announced that they would vote against him. Another committee Democrat, Sen. Jeff Merkely (Ore.), had said long ago that he would oppose Summers, and it was widely assumed that Sen. Elizabeth Warren (D-Mass.) would have joined them as well.

That would have meant that Obama would have had to court Republicans to get Summers confirmed — a difficult task at the same time he would be trying to strip away Republican support for a deal to keep the government open and raise the federal borrowing limits.

“The truth is that it was unlikely he would have been confirmed by the Senate,” said Sen. Bernard Sanders (I-Vt.), a liberal who said he would have voted against Summers if he was approved by the Senate banking committee.

Obama is now short on time to make a nomination, given that the Senate often takes a few months for confirmation. While some speculated Sunday that Obama might turn to Geithner, a person close to the former Treasury secretary said he does not want to be considered.

The decision may give a lift to markets, which were concerned about the uncertainty surrounding the Fed nomination process and the perception that Summers would have been less supportive of the Fed’s efforts to reduce unemployment.

“This news should be positive for the markets,” said Millan Mulraine, director of U.S. rates research at TD Securities. “We could see a rally.”

Summers’s friends expressed regret that the perception of him has been more caricature than reality, arguing that he would have pushed the Fed strongly to reduce unemployment and to demand more transparency in the financial system.