US President Donald Trump's former lawyer Michael Cohen delivered a blistering attack on his ex-boss as he was sentenced to three years in prison on Wednesday for multiple crimes including paying "hush money" to two women who claimed to have had affairs with Trump."It was my duty to cover up his dirty deeds," Cohen said as he pleaded for leniency before US District Judge William H. Pauley III.Cohen, 52, Trump's longtime "fixer," said he was taking responsibility for his personal crimes and "those implicating the President of the United States of America".Cohen's lawyers had asked for no jail time after he admitted tax evasion, making false statements to a financial institution, illegal campaign contributions and making false statements to Congress.But Pauley said Cohen - as a lawyer - "should have known better" and sentenced him to three years in federal prison, ordering him to surrender to custody by March 6."Each of these crimes standing alone warrant considerable punishment," Pauley said, adding that Cohen was "motivated by personal greed and ambition".Before the judge passed his sentence Cohen addressed the court."Today is the day that I am getting my freedom back," he said."I have been living in a personal and mental incarceration ever since the day that I accepted the offer to work for a real estate mogul whose business acumen that I deeply admired," he said.Cohen referenced a tweet from Trump calling him "weak," saying his "weakness was a blind loyalty to Donald Trump".'Hush money' Cohen pleaded guilty to charges brought by federal prosecutors in New York and by the office of Special Counsel Robert Mueller, the former FBI director who is looking into Russian interference in the 2016 election and whether any members of Trump's campaign colluded with Moscow.Among the counts against Cohen was making "hush money" payments to silence two women threatening to go public during the 2016 presidential election campaign with claims they had affairs with Trump.Cohen told prosecutors the payments totaling $280 000 to porn actress Stormy Daniels and former Playboy model Karen McDougal were made "in coordination with and at the direction" of Trump.Both women have claimed to have had sexual encounters with Trump before he was the Republican candidate for president and prosecutors have characterised the payments as illegal campaign contributions intended to influence the election."Cohen deceived the voting public by hiding alleged facts that he believed would have had a substantial effect on the election," prosecutors said.Trump this week sought to minimize the importance of the payments saying they were a "simple private transaction" and that they were "wrongly" being called campaign contributions."Cohen just trying to get his sentence reduced," Trump tweeted. "WITCH HUNT!"In a sentencing memo, the special counsel's office said Cohen had "gone to significant lengths" to assist their investigation.Last month Cohen acknowledged that he lied to Congress about his contacts with Russia about building a Trump Tower in Moscow.Cohen, wearing a dark suit with a light blue tie, arrived for the sentencing with his wife, son and daughter, who was walking with a crutch.For 12 years, Cohen was vice president of The Trump Organisation, the umbrella company for Trump's real estate businesses, and one of the principal confidants of the New York billionaire.Investigators raided Cohen's offices and New York home in April and he admitted in August to hiding about $4m in revenue from his taxi business from the tax authorities.