WikiLeaks founder Julian Assange is to be questioned by Swedish prosecutors inside the Ecuadorian embassy in London, potentially breaking a stalemate in an almost five-year-long investigation into alleged sex crimes.

Swedish prosecutors want to question Assange over allegations of rape stemming from a work visit he made to the country in 2010 when WikiLeaks was attracting international attention for a trove of documents leaked by US Army Private Chelsea Manning, then known as Bradley.

Assange has consistently denied the allegations but declined to return to Sweden to meet prosecutors and eventually sought refuge in the Ecuadorean embassy in London, where he has lived since June 2012.

"In the coming weeks, a date will be set for the proceedings to be held at the embassy of Ecuador in the United Kingdom, in reference to the open legal case in Sweden against citizen Julian Assange," Ecuadorian Foreign Ministry said in an official statement on Wednesday.

READ MORE: UN panel says Assange 'arbitrarily detained' since 2010

The Ecuadorian ministry said that they have been encouraging Sweden to interview Assange in their London embassy since 2012.

"For more than four years, the government of Ecuador has offered to cooperate in facilitating the questioning of Julian Assange in the Ecuadorean Embassy in London, as well as proposing other political and legal measures, in order to reach a satisfactory solution for all parties involved in the legal case against Julian Assange," the statement said.

In December, Ecuador and Sweden finally signed an agreement of mutual legal assistance in criminal matters, which will provide the legal framework for the questioning of the WikiLeaks founder in the London embassy, according to Ecuadorian Foreign Ministry.

Inside Story - Will Julian Assange walk free?

'Arbitrarily detained'

Ecuador said that the proceedings would not affect the validity of a decision by the Working Group on Arbitrary Detentions of the United Nations, which found that Assange was being "arbitrarily detained" by the UK and Sweden.

"The procedures to be followed, under the mutual legal assistance agreement, do not affect the conclusions and recommendations issued by the Working Group on Arbitrary Detentions of the United Nations (opinion 54/2015) which states that Julian Assange is in a situation of arbitrary detention."

READ MORE: Assange hails 'significant victory' after UN finding

After the UN human rights group announced its decision in February, both Sweden and Britain dismissed the ruling, issuing statements saying that Assange is free to leave the embassy whenever he wants.

"Swedish authorities have no control over his decision to stay there. Mr Assange is free to leave the embassy at any point," the Swedish government said at the time.

The UK government said that Assange was avoiding "lawful arrest" by choosing to remain at the embassy and that the government had a legal obligation to extradite him to Sweden.

Source: Al Jazeera