Updated at 5:34 p.m. ET

Jeff Sessions, the president's earliest and most fervent supporter in Congress, resigned under pressure as attorney general on Wednesday after brutal criticism from the president, bringing an abrupt end to his controversial tenure as the nation's top law enforcement officer.

Sessions noted in his resignation letter to the president that he was stepping down "at your request."

President Trump wrote on Twitter after a marathon press conference at the White House that Sessions was out and that Sessions' chief of staff, Matthew Whitaker, would serve as an acting replacement.

Whitaker's responsibilities as acting attorney general will include oversight of the investigation into whether Trump's campaign conspired with the Russian attack on the 2016 election — the inquiry being run by special counsel Robert Mueller.

It wasn't immediately clear what that would mean for Deputy Attorney General Rod Rosenstein, who has been supervising Mueller and has been the public face of the investigation in place of a reticent and press-averse special counsel.

Democrats immediately began to call for Whitaker to recuse himself from oversight of the Mueller inquiry, citing earlier comments by Whitaker about Mueller and his office.

Before he joined the Justice Department, Whitaker wrote for CNN.com that he thought reports about Mueller investigating Trump's finances went too far afield of the special counsel's mandate and that Mueller might be approaching a "red line."

Senate Minority Leader Chuck Schumer, D-N.Y., said on Wednesday that showed Whitaker shouldn't gain any insight into Mueller's work.

"Given his previous comments advocating defunding and imposing limitations on the Mueller investigation, Mr. Whitaker should recuse himself from its oversight for the duration of his time as acting attorney general," Schumer said.

Schumer's call for recusal was echoed by House Minority Leader Nancy Pelosi, D-Calif., who also wrote on Twitter that "Congress must take immediate action to protect the rule of law and integrity of the investigation."

Exit the attorney general

Sessions, 71, lasted not quite two years in the job. But in that brief period, the former Alabama senator managed to usher in a new era at the Justice Department.

Sessions threatened so-called sanctuary cities with the loss of federal funding and announced a "zero-tolerance policy" for people who cross the southern U.S. border illegally.

He decried a looming wave of violent crime across the country, even though criminologists maintain that homicides and assaults remain near historic lows in most places.

He ordered federal prosecutors to seek the most serious charges and stiff prison sentences against drug criminals, a stark reversal of President Barack Obama's most prominent and bipartisan justice policy.

Sessions presided over a rollback in investigations of local police. He rescinded policies that directed federal prosecutors to go after only the biggest cases involving marijuana in states where the drug is legal. And he recommitted to using private prisons for U.S. inmates and detainees.

GOP praise for Sessions; Dems worry about Russia investigation

The resignation elicited predictably mixed reaction from top lawmakers on Capitol Hill.

Sen. Chuck Grassley, R-Iowa, chairman of the Senate Judiciary Committee, which has jurisdiction to conduct oversight of the Justice Department, praised Sessions. "Jeff Sessions is a dedicated public servant and man of honor," Grassley said in a statement, adding, "Jeff deserves the thanks of the nation for his service."

Grassley also spoke highly of Whitaker, saying, "The Justice Department is in good hands during this time of transition."

Sen. John Cornyn, R-Texas, an influential member of Senate Judiciary Committee, likewise praised Sessions:

"As our country's top law enforcement official, he has been integral in fighting the opioid epidemic, keeping violent criminals off our streets, and supporting victims," Cornyn said in a statement. "Those who know him understand his commitment to the rule of law, and his deep and abiding concern for our country."

"I hope everyone will join me in honoring his public service to the country," Cornyn added.

And Sen. Lindsey Graham, R-S.C., another top member of the committee, lauded Sessions.

"Jeff Sessions served our nation well and honorably as Attorney General. He has dedicated his whole life to conservatism and upholding the Rule of Law," Graham said in a statement.

Graham, an increasingly vocal Trump ally in recent months as Sessions' stock declined with the president, said he planned to remain in the Senate amid speculation he could replace Sessions and take the reins of the Justice Department.

"As to me, I will be part of a larger Republican majority in the United States Senate — working with the President and my Republican and Democratic colleagues — to make America safer and more prosperous," Graham also said Wednesday.

While Republicans praised Sessions, Democrats were immediately concerned about the resignation's impact on the Mueller investigation.

"It would create a constitutional crisis if this were a prelude to ending or greatly limiting" the investigation, Schumer said Wednesday when he learned of Sessions' resignation during a press conference.

And top Democrats in the House were equally concerned.

"It is impossible to read Attorney General Sessions' firing as anything other than another blatant attempt by @realDonaldTrump to undermine & end Special Counsel Mueller's investigation," Pelosi, the likely next House speaker, wrote on Twitter.

And Rep. Jerrold Nadler, D-N.Y., tweeted that "Americans must have answers immediately" about the president's reasoning for removing Sessions. Nadler, who is poised to become chairman of the House Judiciary Committee next year and lead that committee's oversight of DOJ, added, "Why is the President making this change and who has authority over Special Counsel Mueller's investigation? We will be holding people accountable."

A long fuse

The seeds of Sessions' departure were planted during his confirmation hearing.

Sessions went out of his way to deny meeting with Russians in the course of the 2016 presidential campaign. His former colleagues in the Senate approved the nomination 52 to 47, despite concerns about allegations of racial insensitivity and hostility to civil rights in his past.

But Sessions soon ran into trouble.

He was forced to correct his Senate testimony to indicate that he had, in fact, met with the Russian ambassador at least twice in 2016. Democrats on Capitol Hill accused him of making false statements. The disclosure provoked intense public scrutiny of his actions.

By March 2017, Sessions fielded questions almost daily about whether he could oversee the ongoing Department of Justice investigation into Russian interference in the election, given his vocal role in the campaign, in which he even donned a "Make America Great Again" hat to support Donald Trump.

Ultimately, after consulting with DOJ ethics officials, Sessions recused himself from the Russia probe. He cited long-standing rules regarding conflicts that arise when authorities investigate campaigns in which they participate.

The recusal decision was hailed by Democrats and good government groups. The president had a different reaction.

Two sources familiar with the situation have told NPR that Trump raged, sometimes profanely, in phone and face-to-face conversations with Sessions. It didn't take long for Trump to voice open regret, on social media and in interviews, about having nominated Sessions.

The president grew even more antagonistic when Sessions' deputy, Rod Rosenstein, appointed a special counsel to lead the Russia investigation after Trump fired FBI Director James Comey.

Trump called the DOJ Russia probe a "witch hunt" and cast aspersions on its leader, former FBI Director Robert Mueller, a registered Republican. Trump's allies produced an ad attacking Mueller's team for donating to Democratic political campaigns.

All the while, Sessions ducked questions on the matter, given his recusal.

But as Mueller hired more than two dozen staff members and prosecutors, with experience in corporate fraud, money laundering, organized crime and executive privilege, Trump exploded. He denigrated Sessions, Rosenstein, Mueller and the entire post-Watergate practice of law enforcement independence from the White House in an interview with The New York Times in mid-July 2017.

"Sessions should have never recused himself, and if he was going to recuse himself, he should have told me before he took the job and I would have picked somebody else," Trump said.

Former Justice Department veterans said those remarks reflected a deep misunderstanding of the culture at the Justice Department and the FBI — which try to insulate their work from politics — and a sense that Trump was acknowledging he wanted his attorney general to protect him in the Russia investigation and not get to the bottom of the matter.

The issue gnawed at Trump, who days later issued a series of early morning tweets on July 22, 2017, wondering why Democrat Hillary Clinton and Comey were not under investigation for unspecified offenses. He repeated the question on July 24, 2017, referring to Sessions as "our beleaguered A.G."

The political establishment in Washington, D.C., began wondering aloud how long Sessions could keep his job. At first, former colleagues in the Senate mobilized and came to his aid, defending his integrity.

At the time, Graham told reporters, "If Jeff Sessions is fired, there will be holy hell to pay." Sen. Chuck Grassley, R-Iowa, who leads the Senate Judiciary Committee, tweeted "no way" would he hold confirmation hearings for a new attorney general in 2017.

For his part, Sessions told Tucker Carlson of Fox News that the barbs from Trump had been "hurtful" but that he served at the pleasure of the president.

Attorney general of everything else

Sessions kept working. He flew to El Salvador for a series of anti-gang meetings in late July 2017. There, the attorney general told graduates of a law enforcement academy that he was "blessed" to serve as the highest justice official in the United States.

"It is an honor I never expected nor one I ever would have thought possible," Sessions said. "And while there are good days and bad days in any job, one thing has been clear to me, it is a privilege to serve one's country in law enforcement to wake up each morning and fight the fight for the rule of law."

And Sessions continued to set the broad priorities of the Justice Department, including a crackdown on illegal immigration and support for cases of religious liberty — although those priorities sometimes came into conflict.

His boss, Trump, appeared to have less respect for the legal system. After the special counsel unsealed indictments against his onetime campaign chairman, Paul Manafort, and Manafort business associate Richard Gates on Oct. 30, 2017, Trump insisted there was "no collusion" with Russia and reiterated his view that the investigation was a waste of time.

In early November 2017, Trump told reporters, "a lot of people are disappointed in the Justice Department, including me." He said he was "frustrated" that he could not direct DOJ or the FBI to take action in specific cases, remarks that Justice Department veterans consider a serious breach.

At the same time, questions about Sessions' conduct during the campaign resurfaced after a guilty plea by onetime foreign policy aide George Papadopoulos.

Papadopoulos told prosecutors that he tried to set up a meeting between Trump and Russian President Vladimir Putin during the campaign and that he mentioned it at a March 2016 meeting attended by both Trump and Sessions.

"These facts appear to contradict your sworn testimony on several occasions," Democrats on the House Judiciary Committee pointed out in a letter to the attorney general.

Sessions would get another chance on Capitol Hill to explain what he did in 2016 and how it related to Russia. In essence, he argued that he had a memory lapse and that recent news accounts of the Papadopoulos plea refreshed his recollection.

"I have always told the truth, and I have answered every question as I understood them and to the best of my recollection," the attorney general told lawmakers at a hearing on Nov. 14, 2017. "But I will not accept and reject accusations that I have ever lied under oath. That is a lie."

Sessions' lawyer confirmed that in early 2018, the attorney general voluntarily sat for an extended interview with special counsel investigators, as a witness in the probe into possible obstruction of justice by the president.

Trump later said he was "not concerned" about that interview.

To the dismay of former Justice Department leaders, Sessions mostly remained silent in late 2017 as the president attacked the DOJ as a "deep state" and tweeted the FBI's reputation was "in Tatters."

And, though he seemed to take action by reportedly directing federal prosecutors and FBI agents to look into Trump's political opponent Hillary Clinton, her email practices and the Clinton Foundation, that wasn't enough for conservative members of his own party.

Two members of the House Freedom Caucus wrote in early 2018 that "it would appear [Sessions] has no control at all of the premier law enforcement agency in the world."

The two conservative House Republicans also suggested even then that it was time for Sessions to go.

Time marches on

Still, the Justice Department moved ahead.

Following the guilty plea by Trump lawyer and fixer Michael Cohen, and the conviction of Manafort on the same day in August, Trump lashed out at Sessions, telling Fox News that the attorney general had never taken control of the Justice Department.

The president added that Sessions only had the plum job because of Sessions' loyalty during the campaign. But in a rare defense of himself and his department, Sessions issued a public statement.

"I took control of the Department of Justice the day I was sworn in, which is why we have had unprecedented success at effectuating the President's agenda— one that protects the safety and security and rights of the American people, reduces violent crime, enforces our immigration laws, promotes economic growth, and advances religious liberty," Sessions said.

So long as he was attorney general, Sessions added, the Justice Department "will not be improperly influenced by political considerations."

Sessions said he was proud of law enforcement officials and agents, whom he described as the best in the world.

Copyright 2018 NPR. To see more, visit http://www.npr.org/.