Michael Cohen, President Donald Trump’s former lawyer and fixer, was sentenced to three years in prison today, followed by three years of supervised release. Cohen plead guilty to nine federal charges stemming from his failure to report millions of dollars in income and making secret payments to women who claimed they had affairs with Trump.

“Recently the president tweeted a statement calling me weak and it was correct, but for a much different reason than he was implying. It was because time and time again I felt it was my duty to cover up his dirty deeds,” Cohen told Judge William Pauley. “I am truly sorry and I promise I will be better.”

Cohen faced a potential maximum penalty of some 45 years in prison, according to information from the U.S. Attorney’s Office for the Southern District of New York.

Prosecutors said last week they believe Cohen committed illegal acts at the direction of Mr. Trump, named “Individual 1” in court filings. The president has denied directing Cohen to do anything illegal.