Julian Assange says he is "entirely innocent" of rape in his testimony to Swedish prosecutors, which he has published online.

In a 19-page statement he gave in a landmark interview to Swedish investigators, the WikiLeaks editor-in-chief also said he had been subjected to "cruel, inhuman and degrading treatment".

The 45-year-old computer programmer has been holed up in the Ecuadorian embassy in London for four years to avoid arrest.

"I want people to know the truth about how abusive this process has been," said the Australian journalist.

"Furthermore, in the past, the prosecution has fed partial information to tabloids that politically opposes me. It is better that my statement, which I am happy with, and which makes it obvious to all that I am innocent, sees the light in full."

In November, 2010, US authorities announced an ongoing criminal investigation into the website and Mr Assange over espionage.

ASSANGE BALCONY

The following month, Swedish prosecutors said they were reopening a case, which they previously closed, surrounding sexual assault allegations from two women in Sweden in August of that year.

Mr Assange, who was briefly locked up in Wandsworth prison, said in his statement: "During the height of the Pentagon’s conflict with me the following month, the allegation was resurrected by the current prosecutor, Marianne Ny.

"It was immediately seized on to extinguish my freedom of movement and harm my reputation."

Last month, for the first time, Ms Ny's deputy and a police officer interviewed Mr Assange at the embassy, where he is an asylum-seeker.

Swedish prosecutors are awaiting transcripts from the Ecuadorian embassy, but he beat them to it by publishing his statement on Wednesday. He has never formally been charged.

Hammond on Assange

His testimony includes detailed accounts of what he calls “consensual and enjoyable” sex with a woman known as ‘SW’, which he says occurred four or five times, and he publishes a string of text messages he claims the woman sent.

SW reportedly says she was asleep during sex, which constitutes rape in Sweden, but Mr Assange says: "I was certain SW was not asleep.

"I was also certain she expressly consented to unprotected sex before such intercourse started.

Julian Assange with Ecuador's Foreign Minister Guillaume Long, centre, and Spanish lawyer and former judge Baltasar Garzon at the Ecuadorean embassy (AFP/Getty)

"This is also evidenced by SW's own text messages."

The 45-year-old also adds: “ Therefore I could not believe my eyes when five days later I saw a headline in a Swedish tabloid that I was suspected of a crime and arrested in my absence.

"I immediately made myself available to Swedish authorities to clarify any questions that might exist, although I had no obligation to do so.”

Whistleblowing controversies of the last decade Show all 12 1 /12 Whistleblowing controversies of the last decade Whistleblowing controversies of the last decade Edward Snowden NSA leak Articles in The Guardian revealed that the US and the UK spied on foreign leaders and diplomats at the 2009 G20 summit. Reuters Whistleblowing controversies of the last decade WikiLeaks' US diplomatic cables leak In 2009, former US soldier Chelsea Manning, downloaded hundreds of thousands of classified US Government documents, and passed them on to Jullian Assange's whistleblowing website WikiLeaks. Among the documents were 250,000 State Department diplomatic cables. One disclosed the close relationship between Russian President Vladimir Putin and then-Italian Prime Minister Silvio Berlusconi, the Guardian reported. Allegations included "lavish gifts", lucrative energy contracts and the use by Berlusconi of a "shadowy" Russian-speaking Italiango-between. Getty Images Whistleblowing controversies of the last decade WikiLeaks' US diplomatic cables leak WikiLeaks' US diplomatic cables leak: In a revelation which bruised the UK's 'special relationship' with the US, WikiLeaks published conversations by US commanders criticising Britain's military operations in Afghanistan. Getty Images Whistleblowing controversies of the last decade WikiLeaks' US diplomatic cables leak WikiLeaks' US diplomatic cables leak: One document disclosed startling levels of corruption in Afghanistan, including an incident involving the then vice-president, Ahmad Zia Massoud, who was reportedly stopped and questioned in Dubai when he flew into the emirate with $52m in cash. Getty Images Whistleblowing controversies of the last decade WikiLeaks' US diplomatic cables leak Another cable documented fears in Washington over Pakistan's nuclear weapons programme, in a volatile country with a strategic position in the Middle East. PA Whistleblowing controversies of the last decade WikiLeaks' US diplomatic cables leak Day four of the gradual drip of leaks exposed allegations that Russia and its intelligence agencies are using mafia bosses to carry out criminal operations, with one cable reporting that the relationship is so close that the country has become a "virtual mafia state". Getty Images Whistleblowing controversies of the last decade Edward Snowden NSA leak In 2013, The Guardian published classified US National Security Agency (NSA) documents, from a then anonymous whistleblower. Four days later he was exposed as former NSA contractor Edward Snowden. A month after the initial leak, the New York Times allegeded that the NSA received emails, video clips, photos, voice and video calls, social networking details, logins and other data held by a range of US internet firms. Whistleblowing controversies of the last decade Edward Snowden NSA leak Since Snowden revealed that the US had eavesdropped on German Chancellor Angela Merkel's phone, German-US relations have been strained. In May 2014, Mrs Merkel said still had significant differences with the United States over surveillance practices and that it was too soon to return to “business as usual," according to the New York Times. Getty Images Whistleblowing controversies of the last decade Edward Snowden NSA leak On 7 June, The Guardian published the Presidential Policy Directive 20, whcih included a list of potential targets for cyber-attacks by the US Government. Rex Features Whistleblowing controversies of the last decade Samy Kamkar iPhone and Android exposé In April 2014, hacker and researcher Samy Kamkar revealed that Android phones collect user location data every few seconds. Files are then transited to Google several times an hour. Getty Images Whistleblowing controversies of the last decade Samy Kamkar iPhone and Android exposé It is believed Apple and Google are using the data to better target adverts to smartphone users, according to The Guardian. Getty Images Whistleblowing controversies of the last decade Samy Kamkar iPhone and Android exposé The two companies have since justified the collection of data. In a letter to the US congress Apple confirmed it collected the data and said that, in order to be useful, "the databases [of tower and network locations] must be updated continuously". A Google spokesman told the Guardian Android phones explicitly asked to collect anonymous location data when users turned them on. Getty Images

He also clarifies that he is not Swedish, does not speak Swedish and has never lived in Sweden, despite widespread confusion among media.

Mr Assange accuses Swedish prosecutors of breaking the rules by releasing his name to a tabloid and talks of the "40 press releases and press conferences about me".

"As a result, to this day more than half a million webpages falsely conflate my name with the word 'rape'," he added.

Trump vs Clinton Like 'Cholera vs Gonorrhoea' - Assange at Green Party Convention

In February, the United Nations called on the UK and Sweden to end ‘arbitrary detention’ and compensate him. It also said his treatment was "cruel, inhuman and degrading".

A Swedish Prosecution Authority spokesman confirmed to The Independent that Mr Assange was still being investigated on one count of "suspicion of rape: less serious crime".

"We know that Julian Assange has published his statement but we can't give any comments about that," said the spokesman.