WASHINGTON -- Attorney General Eric Holder, the first African-American to hold the nation’s top law enforcement position, announced on Thursday his plan to resign the post he’s held for nearly six years as soon as a successor can be confirmed.

At the formal announcement at the White House, an emotional Holder thanked President Barack Obama for what he called the “greatest honor” of his professional life.

“I have loved the Department of Justice ever since as a young boy I watched Robert Kennedy prove during the civil rights movement how the department can -- and must -- always be a force for that which is right,” Holder said. “I hope that I have done honor to the faith you placed in me, Mr. President, and to the legacy of all those that served before me.”

Holder, 63, said he would leave the Justice Department in “the months ahead,” but said he “will never leave the work” and would “continue to serve and try to find ways to make our nation even more true to its founding ideals.”

Obama, who has a close personal relationship with Holder, did not name a candidate to replace him. Holder discussed his plans with Obama on several occasions over the last few months, and finalized his decision at the White House residence over Labor Day weekend, according to a DOJ official. If Holder stays in office until December, he will become the third-longest serving attorney general in the history of the United States.

Obama praised Holder’s long career, noting that he worked with six presidents of different parties, and credited him with restoring the Justice Department’s Civil Rights Division.

"He believes, as I do, that justice is not just an abstract theory. It’s a living and breathing principle," Obama said.

Holder had worked "to make sure that those words 'life, liberty and the pursuit of happiness' are made real for all of us," Obama added.

Holder, a frequent target of Republicans in Congress over the past several years, has made criminal justice reform his top priority in the last year. His Justice Department took significant steps in dialing back the war on drugs, encouraging judges to use discretion in sentencing low-level drug offenders and taking on what Holder decried as "draconian" mandatory minimums.

While his drug reform efforts did earn him some praise from Republicans, many members of the GOP took Holder's exit as an opportunity to criticize the outgoing attorney general.

“Eric Holder is the most divisive U.S. Attorney General in modern history,’’ Rep. Darrell Issa (R-Calif.), a frequent Holder antagonist, said in a statement. “By needlessly injecting politics into law enforcement, Attorney General Holder’s legacy has eroded more confidence in our legal system than any Attorney General before him. Through strong arming reporters, practically ignoring high level wrongdoing, blocking his own agency Inspector General’s access to information . . . Attorney General Holder abused his office.’’

Holder earned praise for his achievements in civil rights, going to bat against voter ID laws and racial profiling, and speaking openly about racism in the United States. However, his civil liberties record left progressives disappointed.

"During his tenure, DOJ approved the drone killing of an American far away from any battlefield, approved the NSA’s mass surveillance programs, failed to prosecute any of the Bush administration torturers, and presided over more leak prosecutions than all previous Justice Departments combined," American Civil Liberties Union executive director Anthony D. Romero said in a statement. "Our hope is that his successor will take his baton and continue to focus on reforms that will positively affect the lives of millions, and also seriously address issues that have yet to receive adequate attention such as the closing of Guantanamo Bay detention camp."

In an interview with The Huffington Post earlier this year, Holder said he had no firm plans about when he would step down.

"In terms of my own thinking of how long do I stay … I talk about tasks and trying to see certain things through," Holder said. "I want to try to get a few things done before I ultimately leave."

According to a report in the Washington Post, those "few things" included his progress on sentencing reform, as well as the way he handled the protests in Ferguson, Missouri, after unarmed black teenager Michael Brown was shot to death by a police officer.

As a private citizen, Holder wants to find ways to help restore trust between law enforcement and minority communities, according to a Justice Department official. Holder visited Ferguson, Missouri, last month and has focused much of his career on civil rights issues.

Holder has plans to visit Scranton, Pennsylvania, on Friday, where he'll complete his goal of visiting all 93 U.S. attorney's offices.

Holder has spoken about his resignation before, telling The New Yorker in February he was planning to leave office sometime this year.