WASHINGTON — Michael D. Cohen said in an interview broadcast Friday that he knew arranging payments during the 2016 campaign to quiet two women who claimed to have had affairs with President Trump was wrong. And, he said, Mr. Trump knew it was wrong at the time, too.

“Of course,” Mr. Cohen, the president’s former personal lawyer, said when asked by the ABC News anchor George Stephanopoulos whether the president was fully aware of what he was doing when Mr. Cohen made the payments.

Mr. Cohen was speaking publicly for the first time since he was sentenced to three years in prison after pleading guilty to helping to arrange payments to the two women, a violation of campaign finance law, and to lying to Congress about the duration of deliberations about a proposed Trump Tower in Moscow.

[Trump improvises new defense in hush money payments.]

“I am angry at myself because I knew what I was doing was wrong,” Mr. Cohen said, his eyes swollen and purple, but he said he had come to terms with the value of telling the truth.