A federal prosecutor told a judge on Friday that former Trump lawyer Michael Cohen should spend between 51 and 63 months in prison for a range of federal crimes including tax evasion and violating campaign finance laws.

He tried to 'influence the election from the shadows,' according to Robert Khuzami, the acting U.S. Attorney for the Southern District of New York, by arranging payoffs to porn actress Stormy Daniels and former Playboy model Karen McDougal in order to avoid October-surprise embarrassments for then-candidate Donald Trump.

Khuzami wrote that Trump was directly involved in the efforts. The president tweeted an hour after the document was filed in New York. that it '[t]otally clears the President. Thank you!'

Cohen has helped Special Counsel Robert Mueller with 'information that assisted ... in ongoing matters,' according to Khuzami's sentencing recommendation memo.

But the level of cooperation, he wrote, was too small to warrant more than token leniency. And Cohen, he revealed, made an 'affirmative decision not to become' a cooperating witness.

A separate memo from Mueller covering a different case in Washington, D.C. related to an aborted attempt to build a Trump Tower in Moscow spells out a greater level of assistance, saying it is sufficient to warrant sentences that run concurrently.

The New York sentencing recommendation tells a story of Cohen working 'in coordination with and at the direction of' Donald Trump – by his own admission – to arrange for the National Enquirer to buy the rights to the two women's stories and 'kill' them, preventing media exposure of their claims.

David Pecker, a longtime Trump friend who was CEO of the National Enquirer's parent company, got an immunity deal from Mueller to divulge his part in the plot.

Former Trump lawyer Michael Cohen should spend between 51 and 63 months in federal prison, according to a prosecutor's memo

The U.S. Attorney for the Southern District of New York wrote that Cohen worked at the direction of President Donald Trump in 2016 to arrange payments to two women for the purpose of keeping their sexual affair allegations from becoming public before the election

Trump tweeted barely an hour after prosecutors filed their court statement about Cohen that it 'totally clears' him

Special Counsel Robery Mueller spelled out in a separate memo four ways in which Cohen has been helpful to his Russia probe

Cohen 'coordinated his actions with one or more members of the campaign,' according to the memo, 'including through meetings and phone calls, about the fact, nature, and timing of the payments.'

And as a result, 'neither woman spoke to the press prior to the election.'

The president said this week in a tweet that Cohen should 'serve a full and complete sentence.'

In Mueller's case, filed just last month, the special counsel alleges that Cohen has admitted lying about his efforts and timing on the Trump Tower Moscow plan, and alleges that he briefed Trump about the project's status in 2016.

Cohen told investigators that the entire projet was scrapped before the Iowa caucuses and New Hampshire primary inJanuary 2016. In fact, however, negotiations related to the proposal were going on through the time of the July Republican National Convention.

Mueller charged Cohen with a felony for lying to his investigators, but said he was truthful in six other sessions where government lawyers plied him with questions.

Mueller's seven-page memorandum says the former Trump fixer 'provided information about his own contacts with Russian interests during the campaign and discussions with others in the course of making those contacts.'

As one example, he cited Cohen's willingness to discuss a November 2015 discussion with 'a Russian national who claimed to be a "trusted person" in the Russian Federation.' That person, he wrote, offered to help create 'synergy' with Trump 'on a government level.'

At the time, Trump was slicing his way through the Republican primary field.

Cohen told Mueller's team that his Russian contact proposed arranging a meeting between Trump and Russian President Vladimir Putin, saying 'that such a meeting could have a "phenomenal" impact "not only in political but in a business dimension as well".'

The Michael Cohen sentencing memorandum from a federal prosecutor in New York recomments 51 to 63 months in prison

Felix Sater (right) is pictured with Donald Trump and Soviet-born Turkish real estate developer Tevfik Arif at the Trump Soho launch party in 2007; Sater was allegdely Michael Cohen's link to the Kremlin

That, he wrote, was a reference to the Moscow Trump Tower proposal. Cohen never followed up, and the project was never built.

Other testimony has revealed that Trump campaign advisers discussed a separate meeting between Trump and Putin in 2016, and that Cohen spoke to a Kremlin official about a possible Trump-Putin meeting after the Republican convention in Cleveland, Ohio.

There have been suggestions over the years that the two men met in Moscow during the Trump-run Miss Universe pageant in 2013, but that claim has not been substantiated.

The Russian contact who offered to be Cohen's go-between in late 2016 is believed to be Felix Sater, a former mobster who pleaded guilty in 1998 to his involvement in a Russian Mafia-led $40 million stock fraud scheme.

Mueller also wrote that Cohen helped his office with information about 'discrete Russia-related matters' that he obtained 'by virtue of his regular contact with [Trump Organization] executives during the campaign.'

And Cohen provided 'relevant and useful information concerning his contacts with persons connected to the White House during the 2017–2018 time period.'

Khuzami's much longer 40-page sentencing memo in the New York case, however, downplays the level of help Cohen may have provided.

'Cohen’s description of those efforts is overstated in some respects and incomplete in others,' Khuzami wrote. 'To be clear: Cohen does not have a cooperation agreement.'

Former Playboy model Karen McDougal (left) and porn actress Stormy Daniels (right) both claimed to have slept with Donald Trump in the past, but the government says Cohen coordinated with Trump to make sure the women were paid for their silence – in effect a pair of massive campaign contributions designed to save the election for Trump

Condemning Cohen's end-around attempt to influence the 2016 election, Khuzami wrote that '[w]hile many Americans who desired a particular outcome to the election knocked on doors, toiled at phone banks, or found any number of other legal ways to make their voices heard, Cohen sought to influence the election from the shadows.'

'He did so by orchestrating secret and illegal payments to silence two women who otherwise would have made public their alleged extramarital affairs with Individual-1,' he added, referring to President Trump.

'Cohen, an attorney and businessman, committed four distinct federal crimes over a period of several years. He was motivated to do so by personal greed, and repeatedly used his power and influence for deceptive ends,' he wrote.

'Now he seeks extraordinary leniency – a sentence of no jail time – based principally on his rose-colored view of the seriousness of the crimes; his claims to a sympathetic personal history; and his provision of certain information to law enforcement.

'But the crimes committed by Cohen were more serious than his submission allows and were marked by a pattern of deception that permeated his professional life (and was evidently hidden from the friends and family members who wrote on his behalf).'

Trump said this week that Cohen's crimes were 'unrelated' to him and his former lawyer should get a long prison term

Trump also referenced Cohen's father-in-law, who according to one book introduced Cohen to Trump. Cohen denied it in the book

Khuzami told the court that Cohen should be punished for 'extensive, deliberate, and serious criminal conduct,' and that 'a substantial prison term is requireda.'

Longtime friends of Cohen assembled a counter-narrative this week to help him stay out of jail – lauding him as a family man who provided advice on school bullying and once offered to buy his teacher a car.

Cohen also fielded pitches from a friend who wanted to open a children's barbershop and helped others get their children into the right school.

He wouldn't so much as sip a glass of wine at a dinner with an acquaintance who proposed selling artisan chocolates, locally grown fresh fruit and nuts at a Trump golf pro shop in California, one friend attested.

'He is what I call the true meaning of a "mensch,"' wrote real estate agent Kelly Gitter, in one of the 37 letters that Cohen allies sent to the judge hearing his case.

President Trump has termed Cohen 'weak' for cooperating with prosecutors. Zealous presidential allies have called him a 'rat' for cooperating with the government at all.

Said White House press secretary Sarah Huckabee Sanders Friday: 'The government’s filings in Mr. Cohen’s case tell us nothing of value that wasn’t already known. Mr. Cohen has repeatedly lied and as the prosecution has pointed out to the court, Mr. Cohen is no hero.'