In his letter to the president, obtained by CNN, Rosenstein announced he will resign effective May 11 after spending two years with the Justice Department. His resignation has been expected since February, when Trump nominated a replacement.
"I am grateful 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, unit, safety, education and prosperity," he wrote.
Rosenstein praised the Justice Department for increasing productivity and lowering crime by securing elections, and informing citizens about "covert foreign influence efforts and schemes to commit fraud."
"I commend our 115,000 employees for their accomplishments and their devotion to duty," he wrote.
Current Attorney General William Barr said Monday that he appreciated the opportunity to work closely with Rosenstein, The Wall Street Journal reported.
"His devotion to the Department and its professionals is unparalleled," Barr said. "Over the course of his distinguished government career, he has navigated many challenging situations with strength, grace and good humor. Rod has been an invaluable partner to me during my return to the department and I have relied heavily on his leadership and judgment over the past several months."
Jeffrey Rosen, Trump's selection to replace Rosenstein as deputy attorney general, is awaiting confirmation by the Senate.