Alberto Gonzales has long been one of George Bush's most trusted advisors, first during his tenure as Texas governor and later as president.
Gonzales first served as White House counsel, in effect the president's top lawyer, until he was confirmed as the first Hispanic U.S. attorney general in 2005. In his brief resignation statement, Gonzales recalled his humble roots as the son of Mexican migrant farm workers and thanked the president for the opportunities he had given him over the years.
"I often remind our fellow citizens that we live in the greatest country in the world and that I have lived the American dream. Even my worst days as attorney general have been better than my father's best days."
The president said he reluctantly accepted Gonzales' resignation and complained that the attorney general's critics had dragged his name through the mud for political purposes.
"After months of unfair treatment that has created a harmful distraction at the Justice Department, Judge Gonzales decided to resign his position and I accept his decision."
But it became clear in recent months that Gonzales had lost the trust and support of not only Democrats in Congress, but Republicans as well. Most disturbing to lawmakers was the way in which Gonzales handled the firing last year of eight U.S. attorneys.
Democrats charged the firings were politically motivated, which Gonzales denied. But even Republicans questioned his credibility after Gonzales testified before Congress about the attorney firings. Among his critics was Republican Senator Charles Grassley of Iowa.
"He did a lot of stupid things. The bottom line of it is that because he had bad public relations, because he did things like firing eight U.S. attorneys that probably should not have been fired, it did weaken his position."
Bud Cummins was one of the eight U.S. attorneys replaced by Gonzales last year.
"His willingness to slander the professional reputations of United States attorneys who had served this president loyally and well was really a horrible thing for him to do. And I hope that someday he reflects on it and apologizes to them for it.
Democrats and some legal experts also criticized Gonzales for appearing to put his loyalty to the president above his responsibility to uphold the nation's laws.
Lawrence Tribe is a professor of constitutional law at Harvard University Law School in Massachusetts.
"He acted very much as the president's hired gun rather than as the chief law enforcement officer of the nation."
Gonzales also played a key role in carrying out the Bush administration's legal strategy as part of the war on terrorism, winning praise from some Republicans.
The attorney general pushed to broaden the president's ability to expand domestic eavesdropping authority to monitor communications among suspected terrorists. Gonzales also drafted the rules for military tribunals used to try terrorism suspects being held at the U.S.
Naval base at Guantanamo Bay, Cuba. That prompted an outcry from civil liberties advocates who said the administration was violating the U.S. Constitution in its pursuit of suspected terrorists. Jonathan Turley is a law professor at George Washington University.
"The greatest disappointment for the Gonzales years is that it could have been so much more for someone who created this historic first, being the first Hispanic attorney general. Gonzales tended to view the rule of law as a vehicle or a tool to reach other goals. The results were some really shocking violations of international law and constitutional law."
President Bush has appointed Paul Clement as acting attorney general until a successor is nominated and confirmed by the Senate.
Clement is currently the U.S. Solicitor General, the Justice Department official who argues the administration's point of view in cases before the U.S. Supreme Court.
Democrats are already warning the president to carefully choose his next candidate for attorney general. This is Senator Charles Schumer, a Democrat from New York.
"Now it will be up to the White House to choose a replacement who is, above all, a professional. Not a partisan, not a pal. Unlike the last time, he needs to pick the best person, not his best friend."
Gonzales is the second high-profile long-serving Bush aide to announce his departure from the government in recent weeks. Earlier, the president's longtime chief political adviser, Karl Rove, also announced that he was leaving the administration by the end of August.