Treasury Secretary Timothy F. Geithner has told President Obama he plans to remain in his job through the fall of 2012, keeping in place Obama’s longest-serving economic adviser after the first-ever U.S. credit downgrade and renewed fears of a second recession.

Geithner, who has been battling financial crises since 2007 as a top Federal Reserve official and then Treasury secretary, considered leaving the administration after Congress raised the federal debt ceiling and reached an agreement with Obama to tame the national debt.

But several developments have made his departure more difficult. The debt ceiling was raised with only hours to spare. The deal to tame the debt fell short of what Geithner and Obama wanted. The economy has suddenly taken a turn for the worse. And on Friday, Standard & Poor’s downgraded the U.S. credit rating for the first time. And the White House, worried that it would be hard to find a suitable replacement, pressured him to stay.

Geithner told the president Friday morning that he would remain in his post. Hours later, he had to go to the White House to meet with Obama again and tell him the nation would likely lose its AAA credit rating.

On Sunday afternoon, Geithner joined an emergency conference call involving the seven major economic powers to discuss the impact of the downgrade.

“Secretary Geithner has let the president know that he plans to stay on in his position at Treasury,” Treasury spokeswoman Jenni LeCompte said in a statement. “He looks forward to the important work ahead on the challenges facing our great country.”

White House press secretary Jay Carney said, “The president asked Secretary Geithner to stay on at Treasury and welcomes his decision.”

Exhausted from the multiple crises of recent years, Geithner and his family had decided to move back to New York, where they lived when he was head of the Federal Reserve Bank of New York. His son will finish his senior year of high school there.

Geithner planned to commute from New York to Washington during the week. He did so during the beginning of the term and didn’t like it, so he considered stepping down to tend to his family needs and get a break from government service.

His departure would have marked the loss of Obama’s longest-serving economic adviser at a time when the recovery has slowed and the unemployment rate remains stubbornly high.

Geithner is the last remaining member of the president’s original economic team. Austan Goolsbee, chairman of Council of Economic Advisers, left Friday. Other key members of the team include National Economic Council director Gene Sperling, a former Treasury counselor who is reprising a role he held in the Clinton administration, and Jacob Lew, the budget director who is likewise reprising a Clinton-era role.

During his tenure, Geithner has continually won over Obama in contentious policy debates. He shaped the president’s response to the financial crisis, successfully arguing that the government should not seize struggling banks.

More recently, he urged Obama to propose cutting the annual deficit by $4 trillion over 10 years, despite other top advisers advocating that the president focus squarely on the nation’s high unemployment.

Geithner turns 50 later this month. He was one of the architects of the Wall Street bailout in the fall of 2008 and faced sharp criticism in his first year as Treasury secretary, including calls for his resignation. He has been accused of protecting the bonuses of Wall Street traders while paying insufficient attention to the nation’s foreclosure epidemic.

In the past, analysts have discussed Roger Altman, an investment banker and deputy Treasury secretary in the Clinton administration, and Erskine Bowles, a former Clinton chief of staff who co-chaired Obama’s deficit reduction commission, as possible candidates for the top Treasury post. But administration officials have feared what a confirmation battle would look like in a time of intense partisanship.