NEW YORK (Reuters) - Donald Trump's longtime fixer Michael Cohen was upset not to be offered a top job in Trump's administration after the Republican businessman-turned-politician won the 2016 presidential election, according to testimony at Trump's criminal hush money trial.

Thursday's testimony by lawyer Keith Davidson could prove relevant during the trial when Cohen, having since split with Trump, is expected to appear as a star prosecution witness.

Cohen will be called to discuss his efforts to pay off porn star Stormy Daniels, who was threatening shortly before the election to go public with her story of a sexual encounter with Trump 10 years earlier.

The former Trump lawyer's credibility will be central to the trial which enters an 11th day on Friday.

Davidson, who as the porn star's lawyer at the time helped arrange the payment, testified Cohen was "very despondent and saddened" during a long phone call after Trump won the election. "I thought he was going to kill himself," Davidson said.

Davidson said he recalled Cohen saying: "I can't believe I'm not going to Washington. I've saved that guy's ass so many times, you don't even know."

He said Cohen, as Trump's personal lawyer, had hoped to be appointed attorney general or White House chief of staff.

In recorded phone calls played for the panel of 12 jurors and six alternates on Thursday, Cohen mused about his next steps after Trump's victory, including whether he should "go rogue" or write a tell-all book.

He eventually did both and emerged as a fierce critic of Trump. He pleaded guilty to campaign-finance violations and was sentenced to prison for paying $130,000 to Daniels to stay silent about her experience.

Trump is charged with falsifying business records to hide the fact that he reimbursed Cohen for that payment. He has pleaded not guilty and denies having had sex with Daniels, whose real name is Stephanie Clifford.

It was unclear whether Cohen or Daniels would take the witness stand on Friday.

While prosecutors normally say ahead of time who will testify, they are not doing so in this trial out of concern that they will be targeted by Trump, who owns his own social media network and speaks regularly to enthusiastic crowds as he mounts a comeback White House bid after his 2020 loss.

The judge in the case is considering whether to fine Trump for calling Cohen a liar last week. Prosecutors say that violates a gag order barring Trump from making public comments about jurors, witnesses and families of the judge and prosecutors if the statements are meant to interfere with the case.

That would follow a $9,000 fine Justice Juan Merchan imposed on Trump on Tuesday for other gag-order violations.

Trump, the Republican candidate in the 2024 presidential campaign, says the gag order limits his free-speech rights, and has portrayed the trial as an attempt to undercut his campaign to defeat Democratic President Joe Biden in the Nov. 5 election.

Merchan on Thursday declined a request by Trump's legal team to vet commentary about the trial before he posts it online.

"When in doubt, steer clear," he said, prompting Trump to shake his head and sigh.

Though the case features sordid allegations of adultery and secret payoffs, it is widely seen as less consequential than the other three criminal prosecutions Trump faces.

Those charge him with trying to overturn his 2020 presidential defeat and mishandling classified documents after leaving office. Trump has pleaded not guilty in these cases and it is unclear whether they will go to trial before the election.

(Reporting by Jack Queen and Brendan Pierson in New York and Andy Sullivan in Washington; Editing by Howard Goller)

By Jack Queen, Brendan Pierson and Andy Sullivan