NEW YORK (AP) — The moment of reckoning has nearly arrived for Michael Cohen, who finds out Wednesday whether his decision to walk away from President Donald Trump after years of unwavering loyalty will spare him from a harsh prison sentence.

A federal judge in New York is set to decide whether Cohen gets leniency or years in prison for crimes including tax evasion, making illegal hush-money payments to protect Trump during the campaign and lying to Congress about the president’s past business dealings in Russia.

Few observers expect the hearing to go well for the 52-year-old attorney.

For weeks, his legal strategy appeared to revolve around persuading the court that he is a reformed man who abandoned longtime friendships and gave up his livelihood when he decided to break with the president and speak with federal investigators. That narrative collapsed last week. New York prosecutors urged a judge to sentence Cohen to a substantial prison term, saying he’d failed to fully cooperate and overstated his helpfulness. They’ve asked for only a slight reduction in the 4- to 5-year term he would face under federal sentencing guidelines.

A sentence of hard time would leave Cohen with little to show for his decision to plead guilty, though experts said Wednesday’s hearing might not be the last word on his punishment.

Cohen could have his sentence revisited if he strikes a deal with prosecutors in which he provides additional cooperation within a year of his sentence, said Michael J. Stern, a former federal prosecutor in Detroit and Los Angeles.

“Few things spark a defendant’s renewed interest in cooperating faster than trading in a pair of custom Italian trousers for an off-the-rack orange jump suit,” he said.

Annemarie McAvoy, a former federal prosecutor in Brooklyn, said prosecutors appear to be angry at Cohen for limiting his cooperation.

“It could be a tactic to try to break him like they’ve tried to do with (Paul) Manafort,” McAvoy said, referring to Trump’s former campaign chairman. “It kind of shows they’re putting the screws to him. If they’re not mad at him, he didn’t give them what they wanted.”

Cohen’s transition from Trump’s fixer-in-chief to felon has been head-spinning.

During the campaign, he coordinated payments to buy the silence of two women — former Playboy model Karen McDougal and adult film actress Stormy Daniels — who were thinking of speaking with reporters about alleged sexual encounters with Trump. Cohen once told an interviewer he would “take a bullet” for Trump.

But months after investigators began gathering evidence that he’d dodged $1.4 million in taxes, Cohen pleaded guilty in August, pledged to cooperate with special counsel Robert Mueller’s investigation of Russian interference in the presidential election and changed his party registration from Republican to Democrat.

Prosecutors said Cohen orchestrated payments to McDougal and Daniels at Trump’s direction.

Trump, who insists the affairs never happened, said Monday in a tweet mocked for its spelling errors that the campaign finance allegations are being made up by Democrats disappointed not to have found a “smocking gun” proving collusion between his campaign and Russia.

“So now the Dems go to a simple private transaction, wrongly call it a campaign contribution ... which it was not (but even if it was, it is only a CIVIL CASE, like Obama’s - but it was done correctly by a lawyer and there would not even be a fine. Lawyer’s liability if he made a mistake, not me). Cohen just trying to get his sentence reduced. WITCH HUNT!” Trump wrote.

U.S. District Judge William Pauley III, who was appointed to the federal bench by former President Bill Clinton, may allow Cohen to begin serving any prison term he receives at a later date. But legal experts said Cohen could also be taken into custody immediately.

“If I were advising him, I’d encourage him to bring his toothbrush to court,” said Stern.

Cohen’s lawyers have asked for no prison time, saying he has suffered enough already.

“The greatest punishment Michael has endured in the criminal process has been the shame and anxiety he feels daily from having subjected his family to the fallout from his case,” his attorneys wrote in a court filing last month. “The media glare and intrusions on all of them, including his children, the regular hate correspondence and written and oral threats, the fact that he will lose his law license, the termination of business relationships by banks and insurers and the loss of friendships, are but some of this fallout.”

Federal prosecutors said the request of a probation-only sentence is unbefitting of “a man who knowingly sought to undermine core institutions of our democracy.”

Mueller’s office took a far kinder view of Cohen’s cooperation in a separate court filing, crediting him for useful insights about attempts by Russian intermediaries to influence Trump, among other matters.

Cohen’s latest plea agreement, reached last month, requires he “provide truthful information regarding any and all matters” Mueller deems relevant. The same document bars Cohen from appealing his sentence unless his prison term exceeds federal guidelines, or he claims to have received ineffective assistance of counsel in his proceedings.

David S. Weinstein, a former federal prosecutor in Miami, said Cohen’s lawyers miscalculated by seeking an “unreasonably lenient” sentence.

“They got a little greedy,” Weinstein said. “Judges take a dim view of lawyers who have played the system. Cohen knew where the line was, and he chose to step over the line.”

__

Associated Press writer Larry Neumeister contributed to this report.