White House press secretary Jay Carney is stepping down from the podium.

President Barack Obama announced Friday that Carney is leaving as his top spokesman. He will be replaced by deputy press secretary Josh Earnest.

Jay Carney Stepping Down as Obama Press Secretary | Jay Carney Out | Jay Carney Resignation

President Barack Obama gives White House press secretary Jay Carney a hug after announcing that Carney will step down later next month, during a surprise visit to the Brady Press Briefing Room of the White House, Friday, May 30, 2014. (AP Photo/Susan Walsh)

Obama entered the White House press room unexpectedly, just a few hours after he announced the resignation of Veterans Affairs Secretary Eric Shinseki.

The president described Carney as a good friend and one of his closest advisers.

“One of Jay’s favorite lines is ‘I have no personnel announcements at this time.’ But I do,” Obama said. “It’s bitter sweet. It involves one of my closest friends here in Washington. In April, Jay came to me and said he was thinking about moveing on and I was not thrilled to say the least. Jay has had to wrestle with this decision for quite some time.”

Carney, a former journalist, has been Obama’s press secretary since February 2011, when he replaced Robert Gibbs. Prior to that, he served as press secretary for Vice President Joe Biden since January 2009.

Obama and Carney hugged in front of the press corps after the announcement.

“It’s been a privilege. Everyday, it’s been a privilege,” Carney said.

Carney has been in the hot seat through numerous Obama administration controversies, including the Benghazi terror attacks, the IRS targeting of conservative groups, problems with Obamacare, and most recently, the veterans waiting list scandal that prompted Shinseki to resign.

He frequently has had contentious interactions with reporters and even been dismissive in responding to questions at times. He was often criticized for referring reporter queries to various other federal departments.

Carney, a former Russia correspondent for Time magazine, was asked about a rumor that he would be nominated to be U.S. ambassador to Russia.

“I can assure you, not,” he said.

Carney worked in Time magazine’s Washington bureau from 1993 to 2008, where he had been a correspondent and later the bureau chief. He was in Moscow for the magazine three years before that. He began his journalism career at the Miami Herald in 1987. Carney is married to ABC News correspondent Claire Shipman.

He said he wanted to spend more time with his family and young children.

“They are never the age they are today again,” Carney said, his voice cracking slightly.

Earnest is a longtime Obama hand, having been with his 2008 campaign during the Iowa caucuses. Obama said his last name describes his personality. The incoming press secretary spoke briefly.

“This is an opportunity to represent the president of the United States, and not just any president, but this president whom I believe in so strongly,” Earnest said.

This post has been updated.