US Attorney General Jeff Sessions has been fired by President Donald Trump.
Mr Trump had criticised his top law official for months, mainly over his refusal to oversee the investigation into alleged Russian meddling in favour of Mr Trump's election in 2016.
Mr Sessions's chief of staff, Matthew Whitaker, who has criticised the inquiry, will take over temporarily.
Special Counsel Robert Mueller is investigating alleged collusion between the Trump campaign and Russia.
Mr Mueller's wide-ranging investigation has resulted in a series of criminal charges against several Trump associates.
Allow Twitter content?
In a resignation letter, Mr Sessions - a former Alabama senator who was an early supporter of Mr Trump - made clear the decision to go was not his own.
"Dear Mr President, at your request I am submitting my resignation," he wrote in an undated letter.
"Most importantly, in my time as attorney general, we have restored and upheld the rule of law," Mr Sessions added, while thanking the Republican president.
"We thank Attorney General Jeff Sessions for his service, and wish him well!" Mr Trump tweeted on Wednesday.
"Clearly, the president has something to hide," opposition Democratic party Senate leader Chuck Schumer said.
"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."
Why was Sessions fired?
Mr Trump has repeatedly pilloried his top law enforcement official since Mr Sessions stepped aside from the Russia inquiry in March 2017.
In July 2017 Mr Trump told the New York Times: "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."
Mr Sessions voluntarily removed himself from the probe after Democrats accused him of failing to disclose contacts with the Russian ambassador during his Senate confirmation hearing.
The attorney general later said he had forgotten about those meetings, which happened during the Trump election campaign.
Mr Trump has at various times belittled Mr Sessions as "VERY weak" and "DISGRACEFUL".
What happens now?
Matthew Whitaker can now assume control of the Mueller inquiry, which has been under the control of Deputy Attorney General Rod Rosenstein until now.
The president cannot directly fire the special counsel, whose investigation Mr Trump has repeatedly decried as a witch hunt. But Mr Sessions's replacement will have the power to fire Mr Mueller or end the inquiry.
Mr Whitaker has not shied away from sharing his concerns over the investigation. For example, in August 2017, he wrote a piece for CNN in which he stated that looking into Mr Trump's personal finances, or those of his family, "goes beyond the scope of the appointment of the special counsel".
He went on to call on Mr Rosenstein to "order Mueller to limit the scope of the investigation" or risk the inquiry starting "to look like a political fishing expedition".
It was the deputy attorney general who appointed Mr Mueller to lead the Russia inquiry, after Mr Trump fired FBI director James Comey in May 2017.
The special counsel's probe has also been investigating whether Mr Comey's firing amounted to attempted obstruction of justice.
There has also been a question mark over Mr Rosenstein's future since it was reported he had discussed invoking a constitutional clause to oust President Trump.
Is Trump trying to shut down Russia probe?
Analysis by Anthony Zurcher, BBC Washington
The presidential axe that had been hovering over Jeff Sessions for what has seemed like an eternity just came swinging down with a thud. Donald Trump had previously said he would wait until after the mid-term elections to decide his attorney general's fate, and he did - but just barely.
And like that the duties of overseeing Robert Mueller's Russia investigation shift from the man who appointed the special counsel, Rod Rosenstein, to a man who has been a critic of it, Department of Justice Chief of Staff Matthew Whitaker.
In an opinion piece for The Hill before he took the Department of Justice job, Mr Whitaker wrote that calls for an as yet-to-be-named independent prosecutor would be "just craven attempts to score cheap political points". In April 2017, he wrote for CNN that any Mueller investigation into the president's finances would be "going too far".
What happens next is critical. Mr Mueller's inquiry could continue unabated - although the special counsel must surely be considering tightening his timeline. There is also the possibility, however, that this is just the opening move of a White House effort to shut down the probe or keep its findings out of the public eye.
Allow Twitter content?
What's the reaction?
Democrats were outraged by the attorney general's removal, with Senate leader Mr Schumer said protecting the Mueller investigation was "paramount" in light of the move.
House of Representatives Democratic leader Nancy Pelosi said: "It is impossible to read Attorney General Sessions' firing as anything other than another blatant attempt by President Trump to undermine & end Special Counsel Mueller's investigation."
Former Attorney General Eric Holder, who served during President Barack Obama's administration, tweeted to say that anyone who tried to interfere with the Mueller investigation "must be held accountable".
Allow Twitter content?
Republican Senator Lindsey Graham said he looked forward to "working with President Trump to find a confirmable, worthy successor so that we can start a new chapter at the Department of Justice".
Mr Graham, of South Carolina, had said last year there would be "holy hell to pay" if Mr Sessions was ever fired.
The senator was previously tipped as a replacement for Mr Sessions, but he seemed to take himself out of consideration on Wednesday, suggesting he would stay in the Senate.