Carney, 49, a former Time Magazine White House correspondent, joined the administration in late 2008 as spokesman for Vice President-elect Biden. He was promoted to Obama's chief spokesman in February 2011, replacing Robert Gibbs.
Earnest, 39, has been Carney's top deputy and regularly fills in for the press secretary during daily briefings at the White House and aboard Air Force One when the president leaves Washington. Carney said Earnest would travel with Obama to Europe next week, and the press secretary said he would formally leave his job in mid-June.
Carney cited spending time with his wife, television journalist Claire Shipman, and children as a reason for his departure, but he did not disclose future career plans. Obama made the surprise announcement in the briefing room, cutting off Carney during an answer to a question about Ukraine.
"Jay has become one of my closest friends and is a great press secretary and a great adviser," Obama said. "He's got good judgement, he has good temperament and he's got a good heart. And I'm going to miss him a lot. I will continue to rely on him as a friend, an adviser after he leaves to spend as much of his summer as he can with his kids before he decides what's next for him."
Carney developed a reputation among his former peers as a disciplined and even-tempered spokesman who rarely disclosed news by mistake or made mis-statements that were damaging to the White House. Carney sparred with reporters regularly, as they pressed him on camera to respond to world crises, domestic politics and White House scandals.
Obama recalled Earnest's work on his 2008 campaign, noting that he served as communications director in Iowa. "In that role, you'd find him spending an extra hour or two helping young staffers make phone calls or knock on doors," the president said. "There was no task that was too small, no detail too unimportant for Josh to attend to."
President Barack Obama gives White House press secretary Jay Carney a hug after announcing that Carney will step down later next month,
Jay Carney suddenly quits as White House press secretary over 'strain on family life' – but was it timed to 'deflect attention' from resignation of scandal-hit VA chief?
Carney will be replaced by his deputy Josh Earnest
President Obama made his second surprise appearance in the White House press briefing room in a single day to announce the passing of the torch
Multiple sources told MailOnline that Carney's decision was a long time in coming
One, a White House insider, said the White House chose Friday for Carney to announce his departure because it would 'deflect attention away' from another high-profile resignation
VA Secretary Eric Shinseki quit Friday morning amid a major scandal involving military veterans who died waiting for medical care
Jay Carney is stepping down as White House Press Secretary over 'strain' on his family life, he announced today. But the decision to leave the Obama administration came weeks ago, multiple sources including one in the West Wing told MailOnline.
'He first started talking about it in late April,' the White House insider said Friday after the decision was made final. 'But the president had the prerogative to pull the trigger when he decided to.'
That time ended up being Friday, just hours after Veterans Affairs Secretary Eric Shinseki resigned amid a major scandal involving faked wait-lists and denied medical care in the VA health system.
'To be honest, the move was more about how to deflect attention away from Eric Shinseki's resignation, and less about giving Jay a thoughtful send-off,' the White House official said.
Carney is a former Washington bureau chief for Time magazine and has held the position at the White House since February 2011. He was previously Vice President Joe Biden's press secretary.
He gushed for reporters that his job has 'been an amazing experience – just, so fulfilling.'
Rumors had swirled around the White House that Carney was angling for a posting as the U.S. ambassador to Russia, but the former Moscow bureau chief for TIME said it wasn't in the cards since his family had only just now 'won me back.'
Carney has not enjoyed a rosy relationship with White House correspondents, often parrying accusations that he has made the West Wing far less accessible to journalists than it had been under previous presidents.
His alternatively glib and cheerful exterior at the briefing podium often gave way to more forceful, sometimes vulgar exchanges with reporters when open-press events spiraled out of control.
In one case, when a reporter with the center-right Daily Caller asked a question out of turn during a 2011 Rose Garden press conference and sparred with Obama over immigration policy, Carney called the news outlet's executive editor – this reporter – and cursed a blue streak, threatening to cancel the reporter's press credentials.
Obama seemed to paper over such outbursts on Friday, saying that Carney 'has good judgment. He has good temperament and he has good heart.'
'Be nice to him on his farewell tour,' the president joked.