US Attorney General Jeff Sessions has resigned, saying the decision has been reached at the request of US President Donald Trump.

Mr Trump, a long-time critic of Mr Sessions, has thanked him for his service.

The businessman-turned-politician has repeatedly criticised Mr Sessions for recusing himself from the investigation into Russia's role in the 2016 election that saw Mr Trump elected to the White House.

His departure was widely expected to come soon after yesterday's congressional elections in which Republicans retained their majority in the Senate but lost control of the House of Representatives.

In a resignation letter, Mr Sessions said he "worked to implement the law enforcement agenda" that Mr Trump campaigned on.

Mr Trump announced Mr Sessions' departure on Twitter. He also announced that Mr Sessions' chief of staff, Matthew Whitaker, will be acting attorney general until a permanent replacement is nominated.

Mr Sessions departs as the United States's top law enforcement officer while Special Counsel Robert Mueller, operating under the auspices of the Justice Department, pursues a wide-ranging collusion investigation that already has yielded a series of criminal charges against several of Mr Trump's associates and has dogged his presidency.

Mr Sessions, 71, was one of the first members of Congress to back Mr Trump's presidential campaign in 2015.

In an opinion piece written for CNN in August 2017, while serving as a commentator for the network, Mr Whitaker, a former US attorney, said Mr Mueller would be crossing a line if he investigated the Trump family's finances.

Republicans had repeatedly urged Mr Trump not to oust Mr Sessions, a conservative Republican former senator from Alabama, before the elections lest it create political fallout.

They also argued that Mr Sessions should be allowed a graceful exit after he doggedly carried out Trump's agenda on illegal immigration and other administration priorities.

Mr Trump was only a few weeks into his presidency in March 2017 when Mr Sessions upset him.

Rejecting White House entreaties not to do so, Mr Sessions stepped aside from overseeing the FBI's probe of potential collusion between the Trump presidential campaign and Russia.

Mr Sessions cited news reports of previously undisclosed meetings he had with Russia's ambassador to Washington as his reason for recusal.

Deputy Attorney General Rod Rosenstein took over supervision of the Russia investigation and in May 2017 appointed Mr Mueller as the Justice Department's special counsel to take over the FBI's Russia probe after Mr Trump fired FBI Director James Comey.

Mr Rosenstein also has faced criticism from Mr Trump.

A permanent replacement for Mr Sessions must be confirmed by the US Senate, which Mr Trump's Republicans will continue to control as a result of the midterm elections.