Deputy Attorney General Rod Rosenstein has handed in his resignation and will be leaving the job in two weeks, according to media reports Monday evening.

Rosenstein's departure from the job has been expected for months, since the confirmation of William Barr as attorney general and amid battles over the special counsel investigation of the president and possible connections between the Trump campaign and Russia.

Rosenstein stayed in the job until special counsel Robert Mueller's investigation was completed and sent to the Justice Department last month. Rosenstein appointed Mueller in 2017 after Attorney General Jeff Sessions recused himself.

A report in the Washington Post said that Rosenstein, in his resignation letter, praised the president for his "personal charm and policy goals."

"As I submit my resignation effective on May 11, I am grateful to you for the opportunity to serve; for the courtesy and humor you often display in our personal conversations; and for the goals you set in your inaugural address: patriotism, unity, safety, education, and prosperity, because 'a nation exists to serve its citizens'," the Post quoted Rosenstein as writing.