Eric Holder, America’s first black attorney general and an unflinching champion of civil rights in enforcing the nation’s laws, announced his resignation Thursday after leading the Justice Department since the first days of President Barack Obama’s term. He is the fourth-longest-serving attorney general in U.S. history.

Holder, the administration’s point man on the civil rights investigation into the police shooting of an unarmed 18-year-old in Ferguson, Missouri, won’t leave until a replacement is confirmed, which means he could remain in office for months.

Senate Republicans signaled they were preparing for a confirmation fight after years of battles with Holder. Said Senate GOP leader Mitch McConnell: “I will be scrutinizing the president’s replacement nominee to ensure the Justice Department finally returns to prioritizing law enforcement over partisan concerns.”

In an emotional ceremony at the White House, Obama called Holder “the people’s lawyer” and credited him with driving down both the nation’s crime and incarceration rate — the first time they have declined together in more than 40 years.

“Through it all, he’s shown a deep and abiding fidelity to one of our most cherished ideals as a people, and that is equal justice under the law,” Obama said.

Holder responded by speaking of how he was inspired as a boy by Robert Kennedy’s leadership on civil rights at the Justice Department, his voice choking as he expressed his thanks to Obama and his own family.

“You got through it,” Obama could be heard telling Holder as the audience stood and applauded.

In a speech earlier this week, Holder described the dual perspective he brought to the job and how it applied to the Ferguson shooting, in which a young black man was shot and killed by a white policeman. He said he had the utmost respect for police as a former prosecutor and the brother of an officer. But, he added, “As an African-American man who has been stopped and searched by police in situations where such actions were not warranted, I also carry with me an understanding of the mistrust that some citizens harbor.”

Holder told The Associated Press in an interview that he’s not sure whether the Justice Department will finish its investigation into the shooting before he leaves. “I don’t want to rush them,” Holder said. He said once out of office, he will direct attention to “issues that have animated me” during his tenure, including criminal justice and civil rights.

“If you asked me what my biggest regret was, I would say that it was the failure to pass any responsible and reasonable gun safety legislation after the shootings in Newtown,” Holder said. He said he thought in the aftermath of the school shootings in Connecticut that the nation would embrace change that was “not radical but really reasonable” on gun ownership.

Holder aggressively enforced the Voting Rights Act, addressed drug-sentencing guidelines that led to disparities between white and black convicts, extended legal benefits to same-sex couples and refused to defend a law that allowed states to disregard gay marriages. He oversaw the decision to prosecute terror suspects in U.S. civilian courts instead of at Guantanamo Bay and helped establish a legal rationale for lethal drone strikes on suspects overseas.

He was a lightning rod for conservative critics and faced a succession of controversies over, among other things, an ultimately abandoned plan to try terrorism suspects in New York City, a botched gun-running probe along the Southwest border that prompted Republican calls for his resignation, and what was seen as a failure to hold banks accountable for the financial system’s near-meltdown.

The Republican-controlled House voted two years ago to make Holder the first sitting Cabinet member to be held in contempt of Congress — for refusing to turn over documents in the gun-running operation known as Operation Fast and Furious. The administration is still fighting in court to keep the documents confidential.

Only three other attorneys general in U.S. history have served longer than the 63-year-old Holder: William Wirt in the administrations of James Monroe and John Quincy Adams, Janet Reno in the Bill Clinton administration and Homer Cummings for Franklin Roosevelt. Holder also is one of the longest-serving of Obama’s original Cabinet members. Two others remain: Education Secretary Arne Duncan and Agriculture Secretary Tom Vilsack.

Holder and his wife are close personally to the Obamas, having recently vacationed together on Martha’s Vineyard, and Obama said Holder told him of his timing over the summer. The attorney general had expressed his desire to conclude his long term for some time.

White House officials said Obama had not made a final decision on a replacement for Holder, who was one of the most liberal voices in his Cabinet. White House press secretary Josh Earnest said naming a new attorney general would be a high priority for the president.

Some possible candidates that have been mentioned among administration officials include Solicitor General Don Verrilli; Deputy U.S. Attorney General James Cole; former White House Counsel Kathy Ruemmler; Preet Bharara, the U.S. attorney for the Southern District of New York; Jenny Durkan, a former U.S. attorney in Washington state, and Sen. Sheldon Whitehouse, a former Rhode Island attorney general.

A former deputy attorney general in the Clinton administration, Holder was pulled away from private practice to reshape a Justice Department that had been tarnished by a scandal involving fired U.S. attorneys and that had authorized harsh interrogation methods for terrorism suspects. He immediately signaled a new direction for the incoming administration by declaring that waterboarding was torture, contrary to the George W. Bush administration’s insistence that it wasn’t.

In the first year of his tenure, Holder was widely criticized by Republicans and some Democrats for his plan to try professed Sept. 11 mastermind Khalid Sheikh Mohammed and other alleged co-conspirators in New York. The plan was doomed by political opposition to granting civilian criminal trials to terrorist suspects, but Holder continued to maintain that civilian courts were the most appropriate venue.

Under his watch, the Justice Department cracked down on news media reporting on national security matters. The department secretly subpoenaed phone records from Associated Press reporters and editors and used a search warrant to obtain some emails of a Fox News journalist as part of a separate leak investigation.

Stung by criticism that the department hadn’t been aggressive enough in targeting financial misconduct, Holder in the past year and a half secured criminal guilty pleas from two foreign banks and multibillion-dollar civil settlements with American banks arising from the sale of toxic mortgage-backed securities. Even then, critics noted that no individuals were held accountable.

On matters of policy, Holder spoke frankly about how his upbringing — his father emigrated from Barbados and his sister-in-law helped integrate the University of Alabama — helped shape his thinking. He referred to America in 2009 as a “nation of cowards” in its discussions of race. He later lamented that “systemic and unwarranted racial disparities remain disturbingly common.”