News that Attorney General Eric Holder is planning to resign evoked disappointment among Democratic lawmakers and cheers from Republicans, whose relationship with Mr. Holder has been fraught with tensions over his six-year tenure.

House Minority Leader Nancy Pelosi‘s announcement of Mr. Holder’s plans at a Congressional Black Caucus Foundation event Thursday was met with gasps from the audience. Members of the Democratic caucus expressed sadness at Mr. Holder’s departure.

“He will be hard to replace,” said Rep. Xavier Becerra (D., Calif.) “He has done a remarkable job of speaking frankly to Americans.”

In a statement, Ms. Pelosi (D., Calif.) called Mr. Holder a “true blessing to our nation.” She cited his efforts on behalf of voting rights, against terrorism and to reduce the federal prison population as examples of his leadership. “Eric Holder has been a dedicated stalwart for civil rights, protecting our homeland and pursuing justice,” she said.

Sen. Patrick Leahy (D., Vt.), chairman of the Senate Judiciary Committee, praised Mr. Holder’s tenure in an MSNBC interview Thursday morning. “I’ve been here through a lot of attorneys general,” he said. “Nobody’s done it better than he has.”

Mr. Leahy said the Senate should hold confirmation hearings “as quickly as possible.” Asked whether he thought lawmakers would try to block the confirmation of a successor, he said that would be the “height of irresponsibility.”

New York Sen. Charles Schumer, a Democrat, released a statement praising Mr. Holder. “Eric Holder served his country long and well in many different capacities,” he said, citing in particular Mr. Holder’s work on behalf of voting rights. “As nefarious forces tried to turn back the hard-won right to vote, Holder was ‘Horatius at the Bridge’ in many cases, preventing or slowing down their regressive march to take away people’s hard-earned rights.”

Lawmakers, who left the Capitol at the end of last week to campaign ahead of November’s midterm elections, mostly tweeted their reactions, with most Republicans expressing relief. Mr. Holder often clashed with Republicans in Congressduring his tenure, and the GOP-controlled House voted in 2012 to hold him in contempt of Congress for refusing to provide documents related to the botched gun-running probe known as Fast and Furious.

“I can’t think of any AG in history who has attacked Louisiana more than Holder,” Louisiana Sen. David Vitter, a Republican, said in a statement. “I’m proud to have voted against his Senate confirmation.”

Earlier, Mr. Vitter had tweeted: “Anyone sad to see Eric Holder stepping down as AG? Not me.”

Rep. Darrell Issa, chairman of the House oversight and government reform committee and a longtime Holder nemesis, tweeted that Mr. Holder was “the most divisive U.S. Attorney General in modern history” and said his “legacy has eroded more confidence in our legal system than any AG before him.” 

Rep. Jeff Duncan, a Republican of South Carolina, was equally pleased to see Mr. Holder go. He tweeted: “Good riddance Eric Holder. Your disregard for the Constitution of the United States will not be missed.”

Rep. Charles Boustany, a Republican of Louisiana, said in a statement that he had been “disappointed at the political, combative, and uncooperative legacy (Holder) built at the Department of Justice” and that Mr. Holder had set a “bad precedent.”

Other lawmakers were more diplomatic. Sen. Lindsey Graham, a Republican of South Carolina, tweeted: “I appreciate AG Holder’s service to our country even though we had strong disagreements at times. I wish him well in future endeavors.” 

Senate Minority Leader Mitch McConnell (R., Ky.) said five years after he voted against confirming Mr. Holder to his position, he is “confident in the wisdom of that decision.” “Holder has placed ideological commitments over a commitment to the rule of law,” he said in a statement. “These are not the qualities the American people look for in the nation’s highest law-enforcement official.”

And Sen. Lamar Alexander (R., Tenn.) expressed this wish in a statement: “I hope the president will nominate an attorney general this time who will faithfully apply the laws Congress has passed and not seek to impose policies the president wishes Congress had passed,” he said. “The role of the top law enforcement officer in the country is to enforce the law—not to advance the president’s agenda.”

The National Republican Congressional Committee, House Republicans’ campaign arm, posted a statement highlighting criticism of Mr. Holder’s tenure. “Holder’s time in office, much like Obama’s, was marked by nothing more than scandal and partisanship,” the post stated, followed by a plug for contributions to the committee.

The Republican Governors’ Association tweeted: “Eric Holder’s resignation as AG is long overdue. Let’s win the U.S. Senate so we can ensure Obama’s next AG isn’t as extreme as he is.”

The conservative FreedomWorks released a statement with the headline “IT’S HAPPENING.” Matt Kibbe, the group’s president, said: “Americans deserve an attorney general who will treat everyone fairly and equally under the law, not a blatant partisan who selectively prosecutes some groups while giving others a pass. His successor should be driven by an impartial respect for the laws of the land, not ideology.”