Julian Assange was offered a “win-win” deal to avoid indictment and extradition to the US, according to the journalist’s barrister fighting his case in a London court.

The Wikileaks founder was visited by then Republican congressman Dana Rohrabacher and Trump associate Charles Johnson in August 2017 when he was sheltering at the Ecuadorian embassy in London, both of whom offered to have the US grand jury case against Assange dropped if he disclosed the name of the source who leaked emails from the Democratic party to the site.

Identifying the source of the emails would have helped to clear up allegations that Russia had aided the Trump campaign in 2016, they hoped.

“The proposal put forward by Congressman Rohrabacher was that Mr Assange identify the source for the 2016 election publications in return for some kind of pardon, assurance or agreement which would both benefit President Trump politically and prevent US indictment and extradition,” barrister for Assange, Jennifer Robinson, told the court.

Assange however did not provide any names to the men, with the threat of extradition still hanging over the Australian.

The White House denied the allegation when it was first mentioned in February, but the latest details have refocused attention on how far US president Donald Trump was willing to go to clear his name during investigations into the alleged role Russia played in his 2016 election victory.

“The president barely knows Dana Rohrabacher other than he’s an ex-congressman. He’s never spoken to him on this subject or almost any subject. It is a complete fabrication and a total lie. This is probably another never-ending hoax and total lie from the DNC [Democratic National Committee],” a White House spokesman said at the time.

In her statement, Robinson said Rohrabacher and Johnson “wanted us to believe they were acting on behalf of the president”.

“They stated that President Trump was aware of and had approved of them coming to meet with Mr Assange to discuss a proposal – and that they would have an audience with the president to discuss the matter on their return to Washington DC,” she said.

“Congressman Rohrabacher explained he wanted to resolve the ongoing speculation about Russian involvement in the Democratic National Committee leaks to WikiLeaks, which were published by WikiLeaks and other media organisations in 2016.

“He stated that he regarded the ongoing speculation as damaging to US-Russian relations, that it was reviving cold war politics, and that it would be in the best interests of the US if the matter could be resolved.

“He and Mr Johnson also explained that any information from Mr Assange about the source of the DNC leaks would be of interest, value and assistance to Mr Trump.

“The meeting was concluded on the basis that Congressman Rohrabacher would return to have a direct conversation with President Trump about exactly what would be done to prevent Mr Assange’s indictment and extradition.”

Rohrabacher, although admitting the meeting did take place, denied acting on behalf of the president in a February statement.

“At no time did I offer Julian Assange anything from the president because I had not spoken with the president about this issue at all. However, when speaking with Julian Assange, I told him that if he could provide me information and evidence about who actually gave him the DNC emails, I would then call on President Trump to pardon him,” he said.

The 2016 Wikileaks disclosure of DNC emails to and from Hillary Clinton were widely portrayed as an attempt by Russia to damage her election prospects, but Donald Trump has so far shown no indication that he will pardon Mr. Assange.

Assange is facing 18 charges in the US, including conspiring to obtain and disclose national defence information, and plotting to hack computers, with legal experts suggesting he could face multiple life sentences in jail.