New York prosecutors trying to convict Donald Trump for falsifying business records face a formidable challenge: They have to convince a jury to trust the testimony of a convicted perjurer.

The credibility of Michal Cohen, Trump’s former lawyer and associate, dominated the fifth week of the former President’s trial. Cohen’s testimony lies at the heart of the charges that Trump allegedly directed a scheme to hide hush-money payments to porn star Stormy Daniels ahead of the 2016 election and lied on business forms to conceal campaign finance violations.

“He’s really the only person for the prosecution who can connect those dots and weave all that evidence together,” says Renato Mariotti, a former federal prosecutor.

But Cohen’s not exactly the ideal star witness. In 2018, Cohen pleaded guilty to eight crimes involving the hush-money scheme including lying to Congress and federal investigators. He spent more than a year in prison before finishing the rest of his three-year sentence in home confinement. “It goes without saying he’s got some credibility issues,” says Anna Cominsky, a New York Law School professor.

Trump’s defense lawyers spent much of the week working to discredit Cohen. In his cross examination, lawyer Todd Blanche depicted Cohen as untrustworthy and driven by vendettas, emphasizing his history of lying and his frequent anti-Trump tirades on social media. He reminded Cohen that he recently called Trump a “dictator douchebag” who belongs in a cage. “Sounds like something I would say,” Cohen replied. Blanche also suggested Cohen had a financial interest in Trump’s demise, pointing to t-shirts and coffee mugs he was selling that said, “Send Trump to the big house not the White House.”

It’s the core strategy of Trump’s defense: to portray Cohen as a disgruntled former employee whose word cannot be trusted. “You’ve got to drive in that this guy’s not a credible person,” says a source close to Trump. “He lies about everything. He didn’t just lie once in his life. He didn’t just lie once to Congress. He lied in court, he lied to investigators, he lied to his wife.”

Trump’s attorneys handled on a secret recording Cohen took of Trump shortly before the 2016 election, which he later released to the National Enquirer. “He surreptitiously recorded Donald Trump in a phone call as blackmail,” the source says. “That’s his client at the time. Completely unethical.”

The burden on prosecutors is to prove beyond a reasonable doubt that Trump ordered Cohen to pay Daniels $130,000 to prevent her from going public about a sexual encounter she allegedly had with Trump in 2006. (Trump denies the affair.) According to Cohen, Trump agreed to repay him a total of $420,000 in monthly installments of $35,000 and record the payments as legal retainers. Invoices and checks show Trump paid Cohen that amount in January and February of 2017, each labeled as legal fees. But only Cohen can explain the reason for those payments.

In court, Cohen recalled discussions with Trump about ensuring Daniels’ silence after the infamous Access Hollywood tape emerged of Trump bragging about grabbing women by the genitals. “Just do it,” Cohen says Trump told him. He also claimed that Trump was worried more about his electoral prospects than his home life. In Cohen’s testimony, Trump said: “Women will hate me. Guys may think it’s cool, but this is going to be a disaster for the campaign.”

To some former prosecutors, Cohen’s testimony delivered the goods necessary to convict Trump, who faces 34 felony charges. “He provided the testimony the prosecution needed on direct examination,” says Barbara McQuade, a former U.S. Attorney. Mariotti agrees: “Those conversations are key to establishing vital parts of the prosecution’s case.”

Ultimately, though, a 12-member jury will determine Trump’s fate. If only one of them concludes that the prosecution failed to prove its case, Trump could walk away.

Blanche’s cross examination of Cohen is set to resume on Monday, and it’s not yet clear whether Trump will testify in his own defense. A source familiar with the matter says a decision has not yet been made.

The case will bend on whether jurors believe Cohen despite his unsavory past. That’s not a novel complication; prosecutors are often forced to rely on witnesses with credibility issues, says Cominsky. But it’s a much graver challenge in the first ever criminal trial against a former and potentially future President. Says Cominsky: “We never know what a jury will do”