President Donald Trump had called for the death penalty to be used for Julian Assange before changing his mind about the Wikileaks founder, the Old Bailey heard.
US lawyer Eric Lewis claimed rumours Mr Trump had been aided by foreign powers in the 2016 election continued to be viewed by the American leader as "undermining his legitimacy", according to his witness statement presented to Assange's extradition hearing.
Assange is fighting extradition to the US following the leaks of hundreds of thousands of classified documents in 2010 and 2011.
The 49-year-old, who has been in high-security Belmarsh Prison for 16 months, is facing 18 charges - including plotting to hack computers and conspiring to obtain and disclose national defence information.
Mr Lewis asserted: "WikiLeaks and Mr Assange pose a threat to the legitimacy of Trump's (election) campaign that he is desperate to squash by diverting attention and imprisoning Mr Assange.