WASHINGTON — President Obama’s top economic adviser, Lawrence Summers, plans to leave the White House at the end of the year, a move that comes as the administration struggles to show an anxious public it’s making progress on the economy.

In a statement, the president said he is grateful for Summers’ service during a time of “great peril for our country.”

“While we have much work ahead to repair the damage done by the recession, we are on a better path thanks in no small measure to Larry’s wise counsel,” Obama said.

Summers will return to Harvard University, a move that a senior administration official said was always part of Summers’ long-standing plans.

Summers is the third high-level member of Obama’s economic team to leave in recent months, following the departure of budget director Peter Orszag and Christina Romer, head of the Council of Economic Advisers, both of whom left this summer.