"We thank Attorney General Jeff Sessions for his service, and wish him well!" Mr Trump wrote on Wednesday.
In a letter, Mr Sessions said he was resigning at the president's request.
Mr Trump lost trust in his top law enforcement officer after Mr Sessions announced that he would step aside from the Russia investigation last year, and allow his deputy Rod Rosenstein to lead the politically-charged probe.
"Dear Mr President, at your request I am submitting my resignation," Mr Sessions said in his letter.
"Most importantly as my time as attorney general, we have restored and upheld the rule of law," he wrote, while also thanking the Republican president.
The president focuses on positives as Republicans lose control of the House but make senate gains.
The Democrats have clawed their way back to a measure of power in the US federal government. The era of unified rule for Donald Trump and the Republicans is over.