Cohen told the House oversight committee this fear is why he decided to testify before the panel.
"Given my experience working for Mr. Trump, I fear that if he loses the election in 2020 that there will never be a peaceful transition of power," he said. And this is why I agreed to appear before you today."
Cohen began his testimony with prepared remarks calling Trump a "racist," a "con man" and a "cheat" and saying he regrets working for him. Cohen said he acted to benefit Trump and his campaign for president in 2016 out of "blind" loyalty he now realizes was misplaced.
For example, Cohen presented evidence that Trump reimbursed him for hush money payments to an adult film star after he was elected president. He showed a wire transfer for $130,000 from Trump to the actress' attorney and a copy of a check Trump gave him for repayment. Other checks bore Donald Trump Jr.'s name. He also said Trump made efforts during the 1960s to dodge the Vietnam War.
Previously known as Trump's "fixer," Cohen expressed remorse for his actions and said he's "not a bad person."
"I am no longer your 'fixer,' Mr. Trump. I am going to prison and have shattered the safety and security that I tried so hard to provide for my family," he said. "My testimony certainly does not diminish the pain I caused my family and friends -- nothing can do that."
Democrats on the panel asked a wide range of questions related to Trump, while some Republicans assailed Cohen's character and credibility.
Rep. Debbie Wasserman Schultz, D-Fla., asked Cohen whether Trump's "win at all costs" attitude would prompt him to collaborate with a foreign power.
Cohen answered, "Yes," adding that he's limited in what he can say because of the Justice Department's Russia investigation.
"Mr. Trump's desire to win would have him work with anyone," Cohen said. "This was just business as usual."
Cohen also detailed a time in 2016 when Donald Trump Jr. whispered something to the president about a Russian meeting -- to which the commander in-chief replied, "That's good. Let me know." He said he doesn't have hard evidence of collusion with Russia, but said special counsel Robert Mueller's office has information about that.
Cohen told the panel that being around Trump was "intoxicating" to the point that he ignored his conscience. He also said as a general rule of business, Trump inflates his net worth when it benefits him and downplays his income when it's tax time.
Responding to questioning from Rep. Alexandria Ocasio-Cortez, D-N.Y., Cohen confirmed Trump inflated his assets to an insurance company. Cohen told her the committee could further investigate the matter by reviewing his financial statements and tax returns.
Trump refused to release his tax returns during the 2016 election because he said they were under audit by the Internal Revenue Service. Cohen told Rep. Jimmy Gomez, D-Calif., he didn't know whether his tax returns were actually under audit.
"I asked for a copy of the audit so that I could use it in terms of my statements to the press, and I was never able to obtain one," Cohen said.
"Statements that he has said to me is that what he didn't want was to have an entire group of think tanks that are tax experts run through his tax return and start ripping it to pieces and then he'll end up in an audit and he'll ultimately have taxable consequences, penalties and so on," he added.
"I am ashamed of my own weakness and misplaced loyalty -- of the things I did for Mr. Trump in an effort to protect and promote him," Cohen told the House. "I am ashamed because I know what Mr. Trump is. He is a racist. He is a con man. He is a cheat."
Cohen was also asked why he feared for his family's safety when he previously said he'd testify in Congress.
"When Mr. Trump turned around early in the campaign and said, 'I can shoot somebody on Fifth Avenue and get away with it,' I want to be very clear -- he's not joking," Cohen said. "He's telling you the truth. You don't know him. I do. I sat next to this man for 10 years. I started the campaign."
Cohen said Trump has used Twitter to talk about his in-laws, parents and other relatives to threaten him in hopes he wouldn't testify.
"He's sending out the same message that he can do whatever he wants," he said. "He would use others. I'm not sure he would have to hire them. They're already working there."
On his accusation of racism, Cohen at one point recalled occasions years ago when Trump used expletives to talk about countries run by black leaders.
"While we were once driving through a struggling neighborhood in Chicago, he commented that only black people could live that way," he said. "And, he told me that black people would never vote for him because they were too stupid.
"Mr. Trump is a racist. The country has seen Mr. Trump court white supremacists and bigots ... In private, he is even worse.
"He has done great things, but this destruction of our civility is out of control," Cohen said. "The more people that follow Mr. Trump as I did blindly are going to suffer the same consequences."
Cohen told the committee Trump knew about communications between WikiLeaks founder Julian Assange and political operative Roger Stone on hacking Democratic National Committee emails before the 2016 election. Those emails were later leaked and damaged the campaign of Democrat Hillary Clinton.
Cohen also admitted to lying to Congress about negotiations for a Trump Tower in Moscow, which he previously said ended in January 2016. He faces prison time for those lies.
"I hope my appearance here today, my guilty plea, and my work with law enforcement agencies are steps along a path of redemption that will restore faith in me and help this country understand our president better," Cohen said.
Trump's campaign released a statement Wednesday calling into question Cohen's credibility.
"Michael Cohen is a felon, a disbarred lawyer, and a convicted perjurer, who lied to both Congress and the special counsel in a 'deliberate and premeditated' fashion according to the special counsel's office," national press secretary Kayleigh McEnany said.
"Now he offers what he says is evidence, but the only support for that is his own testimony, which has proven before to be worthless. This is the same Michael Cohen who has admitted that he lied to Congress previously.
"Why did they even bother to swear him in this time?"
At one point, Cohen talked about Trump's opinion that former Arizona Sen. John McCain was no war hero because he was captured by North Vietnamese. He said it's ironic Trump used a medical deferment for bone spurs to avoid serving in the Vietnam War.
'"You think I'm stupid? I wasn't going to Vietnam,'" he recalled Trump saying. "I find it ironic, President Trump, that you are in Vietnam right now."
Cohen was disbarred in New York Tuesday following a private meeting with the Senate intelligence committee. Thursday, he will meet privately with the House intelligence committee.