Tokyo, Japan (CNN) -- In the first major shakeup among President Obama's senior staff, White House Counsel Greg Craig announced his resignation Friday.
The resignation will take effect on January 3, according to a letter Craig sent to Obama.
Craig is being pushed out in favor of veteran Democratic lawyer Bob Bauer because of a dispute over plans to close the U.S. military prison at Guantanamo Bay, Cuba, CNN learned Thursday.
"I want to tell you how proud I am of all that your legal team has accomplished on your behalf," Craig wrote in the letter. "It has been a busy first year (for the administration), and I feel very lucky to have been part of it."
Obama, in a written statement, called Craig a "close friend and trusted adviser who tackled many tough challenges."
The move was announced while the president was in Japan at the start a four-nation tour of Asia.
Bauer is the husband of Anita Dunn, the outgoing White House communications director. Dunn, who recently led a so-called "war" on Fox News, announced earlier this week that she is leaving her White House post, a long-anticipated move that was not connected to the media battle.
Democratic officials said Craig was ousted because of frustration among senior White House aides over his handling of the plans to close the prison at Guantanamo Bay. As the White House's top lawyer, Craig was pivotal in advising Obama to sign an executive order during his first week in office promising to shut the prison by the end of January 2010.
In a politically embarrassing move that has frustrated some of the president's liberal supporters, White House aides have since backed off that deadline, citing complex legal issues surrounding what to do with the approximately 200 terror suspects still detained at Guantanamo.
Some administration officials privately believe Craig should have better anticipated the pitfalls. However, his supporters think he is being used as a scapegoat and note he was not the only top official who supported the ironclad executive order.
One of the Democratic officials acknowledged Craig's tenure had been a "little choppy," but downplayed the exit as part of the normal turnover in any administration after nearly one year in office.
Craig was one of the lawyers who defended President Clinton during his impeachment trial. He became an early and active supporter of Obama in the Democratic presidential primaries, angering backers of then-Sen. Hillary Clinton. That is one of the reasons why allies of Craig are frustrated he is being replaced so early in the administration.
But Democratic sources said Craig never clicked with senior White House aides, and Bauer is a low-key, behind-the-scenes operator more in Obama's comfort zone.
Bauer was the chief attorney during the campaign, and will be leaving the law firm of Perkins Coie, a Seattle-based firm that has an office in Washington, D.C.
There has been speculation that administration officials have been trying to find a federal judgeship or ambassadorial post for Craig, but officials said he may return to the law firm of Williams & Connolly.