WASHINGTON – Michael Cohen, the man tasked with keeping Donald Trump's deepest secrets, offered Congress a damning portrait of his former boss on Wednesday, saying the president encouraged him to lie to Congress and the public for Trump's protection.

During an often combative appearance before a House committee, Cohen delivered a searing account of his dealings with the man who he helped win the White House, casting Trump as a "racist," a "con man" and a "cheat" and tying the White House more directly than ever to criminal investigations that have shadowed Trump's presidency.

And when his own credibility was directly and frequently challenged as a recently convicted felon who lied to Congress two years ago about his own dealings on behalf of the president, Cohen countered that he had served Trump and his business for a decade and that few people are in a better position to offer insights about his former boss and the organization he built around himself.

"He doesn't give orders," Cohen told the committee. "He speaks in a code. And I understand the code, because I've been around him for a decade."

In more than six hours of sworn testimony, Cohen asserted that Trump knew WikiLeaks planned to release stolen emails that were damaging to political rival Hillary Clinton. "Wouldn't that be great," he said Trump replied when informed of the prospect during the 2016 campaign.

Cohen told the panel that Trump helped engineer and personally reimbursed Cohen for an illegal hush-money payment to a porn star, then told him to lie about the arrangement. And he said the president indirectly encouraged him to lie to Congress about his pursuit of a potentially lucrative Trump Tower development in Moscow, even as Trump repeatedly denied any business interests in Russia throughout the 2016 campaign.

"Mr. Trump did not directly tell me to lie to Congress," Cohen said. "That's not how he operates. He would look me in the eye and tell me there's no business in Russia and then go out and lie to the American people by saying the same thing. In his way he was telling me to lie about it."

Cohen said he shared his false statement with Trump's personal lawyers, including Jay Sekulow, before he provided it to Congress. "There were several changes that were made" during that review, he said.

Sekulow said the allegation is "completely false."

The disclosures went on, as Cohen suggested that Trump knew in advance of a June 2016 meeting at Trump Tower, headed by Donald Trump Jr., in which a Russian lawyer promised to provide damaging information on Clinton. "I recalled Don Jr. leaning over to his father and speaking in a low voice, which I could clearly hear, and saying: 'The meeting is all set.' I remember Mr. Trump, saying, 'OK, good ... let me know."

Cohen, however, could not pinpoint when he saw the interaction between father and son. Nor did he elaborate on whether the two could have been referring to another unrelated meeting.

The series of events described by Cohen, who is set to begin a three-year prison term for pleading guilty to a string of financial crimes and lying to Congress, are at the heart of several ongoing criminal investigations, including Justice Department special counsel Robert Mueller's inquiry into Russia's interference in the 2016 election. And he disclosed that he remains in "constant contact" with federal prosecutors from Manhattan who are in the midst of a wide-ranging review that includes the Trump Organization.

Part of that investigation, Cohen said, involves his most recent conversation with the president, which occurred two months after the FBI raided the attorney's offices and home in April 2018. Cohen said other conduct involving the president also was under investigation by the Manhattan prosecutors. He declined to elaborate, because he said prosecutors had asked him not to.

He acknowledged that he hoped his cooperation could lead to a reduced prison term.

Read:Michael Cohen's opening statement to Congress

Cohen:From Trump fixer to Mueller informant: Timeline of Michael Cohen's role in Russia probe

Highlights:From threatening schools to racist remarks: Five alleged Trump deeds Cohen plans to share

"I am ashamed of my weakness and misplaced loyalty – of the things I did for Mr. Trump in an effort to protect and promote him," Cohen said. "I am ashamed that I chose to take part in concealing Mr. Trump's illicit acts rather than listening to my conscience. I am ashamed because I know what Mr. Trump is. He is a racist. He is a con man. He is a cheat."

Cohen acknowledged his past criminal conduct and said his testimony represented a clean break from Trump, whose actions Cohen described as akin to those of a Mob boss.

"I have done bad things, but I am not a bad man. I have fixed things, but I am no longer your fixer, Mr. Trump," Cohen said, adding that he would not seek or accept a pardon should one be offered by the president.

In addition to his written testimony, Cohen arrived at the House Oversight and Government Reform Committee hearing Wednesday with documents that appeared to back up some of his claims, including a $35,000 check signed by Trump. Cohen said the personal check, signed during the first year of his presidency, was one of 11 "installment" payments to reimburse him for the hush money payment to adult film star Stormy Daniels, who says she had an affair with Trump.

Other installment checks were signed by Donald Trump Jr. and Trump Organization finance chief Allen Weisselberg, Cohen said. Asked by Rep. Ro Khanna, D-Calif., whether his testimony indicated that they and Trump had engaged in a "criminal conspiracy of financial fraud," Cohen replied: "Yes."

Cohen ticked off a list of names of people who could provide additional information about the transactions, including Weisselberg, Trump Organization attorney Alan Garten and David Pecker, publisher of the National Enquirer, who assisted in the hush money scheme.

Federal prosecutors in New York say Trump’s private business reimbursed Cohen $130,000 for his payment to Daniels, added another $130,000 to cover his taxes and paid him a $60,000 bonus on top of that, then disguised the payments as legal bills.

"Everything was done with the knowledge and at the direction of Mr. Trump," he said.

Cohen said Trump orchestrated the "cover-up" and directed him to lie about the transactions, even to the president's wife. "Lying to the first lady is one of my biggest regrets," Cohen said as camera shutters clicked. "She is a kind, good person. I respect her greatly, and she did not deserve that."

Cohen said Trump's misconduct extended to the characterization of his personal financial status.

"It was my experience that Mr. Trump inflated his total assets when it served his purposes, such as trying to be listed among the wealthiest people in Forbes, and deflated his assets to reduce his real estate taxes," Cohen said. He said Trump also inflated the value of his assets to obtain insurance policies.

Trump didn't even wait for Cohen to begin his testimony before firing back from Vietnam, where he was meeting with North Korean leader Kim Jong Un.

"Michael Cohen was one of many lawyers who represented me (unfortunately)," Trump tweeted from Hanoi, site of his second summit with Kim. "He had other clients also."

Noting that Cohen has been disbarred, the president said "he did bad things unrelated to Trump," and "is lying in order to reduce his prison time."

Cohen's testimony, however, went beyond Trump's business and campaign dealings to describe his former boss a "a racist."

Publicly, Cohen said, Trump courted white supremacists and bigots.

"In private, he was even worse," the attorney said. "He once asked if I could name a country run by a black person that wasn't a 'shithole.' ... While we were once driving through a struggling neighborhood in Chicago, he commented that only black people could live that way. And he told me that black people would never vote for him because they were too stupid. And yet I continued to work for him."

The House committee's chairman, Rep. Elijah Cummings, D-Md., warned Cohen that members would seek to assess his credibility given his criminal conduct, as well as the president's. Lawmakers sought details on everything from Trump's finances to the operation of his private business. They also questioned whether Trump complied with tax laws and campaign finance regulations.

Cohen has confessed to committing crimes for Trump's benefit, and he came ready to unload on the president Wednesday.

Trump's defenders were equally ready for fireworks. Hours before Cohen was due to testify, one of the president's staunchest defenders in Congress, Rep. Matt Gaetz, R-Fla., asked him on Twitter whether his "wife & father-in-law know about your girlfriends?" He mused: "I wonder if she’ll remain faithful when you’re in prison. She’s about to learn a lot."

On Wednesday, Republican members sought to postpone the hearing, claiming that Cohen had not provided a copy of his testimony in a timely manner. The effort was derailed, but the fight to discredit Trump's former lawyer went on.

Ohio Rep. Jim Jordan, the panel's ranking Republican, seized on Cohen's past false statements to Congress.

"Here we go," Jordan told the packed gallery. "This might be the first time someone convicted of lying to Congress has been brought back" to testify so quickly.

"We are legitimizing dishonesty," Jordan said. "We are de-legitimizing this institution."

As Cohen read from the 20-page statement, Rep. Mark Meadows, R-N.C., shook his head in visible contempt.

Rep. James Comer, R-Ky., also drilled Cohen, referring to the attorney's admitted criminal conduct and then drew a ripple of laughter with a brief question followed by an unexpected answer.

"What would you call yourself?" Comer asked the witness.

"A fool," Cohen shot back.

Virtually every question from a Republican lawmaker contained a reference to Cohen's damaged credibility. Few sought more information about Cohen's claims against Trump.

When it was Rep. Paul Gosar, R-Airz., turn, a poster appeared behind the Republican members carrying the slogan: "Liar Liar Pants on Fire!"

At one point, the tense exchanges prompted Rep. Stephen Lynch, D-Mass., to challenge Republicans: "Your side ran away from the truth," Lynch thundered. "We're trying to bring it to the American people."

Cohen then interjected, urging skeptical Republicans to review the documents that supported his claims against the president.

"You don't have to take my word for it," Cohen said at one point. "Look at the documents ... I did the same thing that you are doing now. I protected Mr. Trump for 10 years."

Cohen had long been among Trump's most voluble defenders. Responding to a question from Rep. Jackie Speier, D-Calif., Cohen said he threatened as many as 500 people at Trump's behest, including journalists. But last year, before he was sentenced to prison, he told a judge he had been blinded by misguided loyalty. "Time and time again, I felt it was my duty to cover up his dirty deeds," he said at the time.

Cohen, the combative lawyer who once vowed that he would "take a bullet" for his former boss, has pleaded guilty and agreed to cooperate in investigations of Russian interference in the 2016 election and illegal payments to women who claimed to have had sex with Trump. Both Cohen and the Justice Department have alleged in court that Trump directed Cohen to make the payments, though they stopped short of accusing the president himself of violating the law.

Trump has said he was not involved in Cohen's crimes and has described his former lawyer as a "liar" and a "rat." White House spokeswoman Sarah Sanders said "it's laughable that anyone would take a convicted liar like Cohen at his word, and pathetic to see him given yet another opportunity to spread his lies."

At the end of more than six hours Wednesday, Cohen appeared spent. He wiped tears from his eyes as Cummings offered an emotional postscript to the extraordinary session, suggesting that Cohen's testimony could help repair a wounded government.

"I've sat here and listened to all of this, and it's very painful; it's very painful," Cummings said.

Cohen's testimony Wednesday does not end his interaction with Congress. He is scheduled to testify again in closed session Thursday before the House Intelligence Committee.

Testimony:Michael Cohen, once keeper of Donald Trump's secrets, plans to accuse the president of 'criminal conduct'

Takeaways:Cohen takeaways: As Trump's former lawyer heads to prison, political and legal implications grow for White House