Swedish prosecutors attempted to drop extradition proceedings against Julian Assange as early as 2013, according to a confidential exchange of emails with the Crown Prosecution Service seen by the Guardian.

The sequence of messages also appears to challenge statements by the CPS that the case was not live at the time emails were deleted by prosecutors, according to supporters of the WikiLeaks founder.

Assange was first questioned over allegations of sexual assault and rape in Sweden, which he denies, in 2010. He travelled to the UK later that year and Swedish authorities began extradition proceedings against him.

He subsequently skipped bail and was granted asylum in the Ecuadorian embassy in London in 2012 in order to avoid extradition. It was not until last year that the Stockholm publicly announced they had dropped their European arrest warrant application for him.

Assange still faces arrest for breaching his former bail conditions in the UK if he leaves the embassy in Knightsbridge. He fears there is a secret US indictment against him relating to WikiLeaks’ disclosure of leaked classified US documents.

The newly-released emails show that the Swedish authorities were eager to give up the case four years before they formally abandoned proceedings in 2017 and that the CPS dissuaded them from doing so.

Some of the material has surfaced from an information tribunal challenge brought late last year by the Italian journalist Stefania Maurizi.

The CPS lawyer handling the case, who has since retired, commented on an article which suggested that Sweden could drop the case in August 2012. He wrote: “Don’t you dare get cold feet!!!”.

As the case dragged on, the Swedish director of public prosecutions, Marianne Ny, wrote to the CPS on 18 October 2013 explaining that she had few options left. “There is a demand in Swedish law for coercive measures to be proportionate,” she informed London.

“The time passing, the costs and how severe the crime is to be taken into account together with the intrusion or detriment to the suspect. Against this background, we have found us to be obliged to lift the detention order ... and to withdraw the European arrest warrant. If so this should be done in a couple of weeks. This would affect not only us but you too in a significant way.”

Not all the emails are preserved in the exchange, but three days later Ny emailed the CPS again to say: “I am sorry this came as a [bad] surprise... I hope I didn’t ruin your weekend.”

The CPS lawyer wrote back to Ny in December 2013, insisting: “I do not consider costs are a relevant factor in this matter.” This was at a time when the Metropolitan police had revealed that its security operation to prevent Assange escaping from the embassy had already cost £3.8m. “I do wonder occasionally if the police just make public comments because they think it will somehow progress a case,” he wrote.

“All we can do is wait and see [and perhaps be eternally grateful that neither of us have to share a room in the embassy with him over Christmas!].”

At the beginning of the legal battle over Assange in 2011, the CPS advised Swedish prosecutors not to interview him in Britain, but they eventually did.

The CPS lawyer also told Ny that year: “It is simply amazing how much work this case is generating. It sometimes seems like an industry. Please do not think this case is being dealt with as just another extradition.”

Assange’s supporters allege that the CPS has been inconsistent in declaring whether or not the case was live. In dismissing a personal data request by him in April 2013, the CPS wrote that they could not release anything “because of the live matters still pending”.

But when explaining the deletion of emails about the case in 2014, after the CPS official who had been corresponding with Ny retired, it was defended on the grounds that: “The case was, therefore, not live when the email account was deleted.” Little had changed over that period, Assange’s supporters maintain.

A CPS spokesperson said: “As there are legal proceedings still under way it would be inappropriate to comment.”

Westminster magistrates court is due to deliver judgment on Tuesday in response to arguments from Assange’s lawyers that continuing to enforce the arrest warrant is disproportionate after so many years.

The UK supreme court ruled last week in relation to a case about the Chagos Islands that diplomatic cables published by WikiLeaks are admissible as evidence in the dispute over creating a marine protection zone in the British territory.