Jay Carney, who fielded reporters' tough questions for more than three years as White House press secretary, will resign.
President Obama interrupted the Friday media briefing to make the announcement.
"Jay's had to wrestle with this decision for quite some time," Obama said, announcing the move.
"Jay has become one of my closest friends," he said.
Carney said he'd asked to leave in April and that he would depart officially in mid-June.
"It's been an amazing experience. Just so fulfilling," he said. "It's been a privilege and it continues to be a privilege to serve."
Josh Earnest, Carney's deputy, who currently holds the title of White House special assistant to the president, will become the new press secretary.
Obama described Earnest as "a straight shooter and a great guy."
The New York Times says of Carney's resignation:
"Despite coming from the White House press corps himself, Mr. Carney developed a sometimes contentious relationship with the news media, who often pressed Mr. Carney to say more than he was willing to about the president's policies and decision-making.
"Mr. Earnest, who has worked for Mr. Obama since the 2008 campaign, was the obvious choice to replace Mr. Carney. He has stood in for Mr. Carney at times in the briefing room, and Mr. Carney said Mr. Earnest would go to Europe with the president next week."