Ecuador's president, Rafael Correa, has agreed to grant Julian Assange asylum, officials within Ecuador's government have said. The WikiLeaks founder has been holed up at Ecuador's London embassy since 19 June, when he officially requested political asylum.

"Ecuador will grant asylum to Julian Assange," said an official in the Ecuadorean capital, Quito, who is familiar with the government discussions.

On Monday, Correa told state-run ECTV that he would decide this week whether to grant asylum to Assange. Correa said a large amount of material about international law had to be examined to make a responsible, informed decision.

Ecuador's foreign minister, Ricardo Patiño, indicated that the president would reveal his answer once the Olympic Games were over. But it remains unclear if Assange will be allowed to leave Britain and fly to Ecuador, or the move amounts to little more than a symbolic gesture.

At the moment he faces arrest as soon as he leaves the embassy for breaching his bail conditions.

"For Mr Assange to leave England, he should have a safe pass from the British [government]. Will that be possible? That's an issue we have to take into account," Patiño told Reuters on Tuesday.

Government sources in Quito confirmed that despite the outstanding legal issues, Correa would grant Assange asylum – a move that would annoy Britain, the US and Sweden. They added that the offer was made to Assange several months ago, well before he sought refuge in the embassy, and following confidential negotiations with senior London embassy staff.

An official with knowledge of the discussions said the embassy had discussed Assange's request. The British government, however, "discouraged the idea", the official said. He described the Swedish government as "not very collaborative".

The official added: "We see Assange's request as a humanitarian issue. The contact between the Ecuadorean government and WikiLeaks goes back to May 2011, when we became the first country to see the leaked US embassy cables completely declassified ... It is clear that when Julian entered the embassy there was already some sort of deal. We see in his work a parallel with our struggle for national sovereignty and the democratisation of international relations."

However, on Tuesday night after the Guardian broke the story Correa wrote on Twitter: "Rumour of asylum for Assange is false. There is still no decision on the subject. I await report from [Ecuadorian] foreign office." Assange retweeted the message.

Assange took refuge in the embassy to avoid extradition to Sweden, where he is wanted for questioning over allegations of sexual misconduct. He is said to be living in one room of the diplomatic building, where he has an internet connection.

Ecuadorian diplomats believe Assange is at risk of being extradited from Sweden to the US, where he could face the death penalty. Assange's supporters claim the US has already secretly indicted him following WikiLeaks' release in 2010 of US diplomatic cables, as well as classified Afghan and Iraq war logs.

Correa and Patiño have both said that Ecuador will take a sovereign decision regarding Assange. They say they are seeking to protect Assange's right to life and freedom. On Monday the state-run newspaper El Telégrafo confirmed that a decision had been made, although it did not specify what that decision was. It said senior officials had been meeting to iron out the last legal details.

Two weeks ago Assange's mother, Christine, paid Ecuador an official visit, following an invitation from the foreign affairs ministry. She met with Correa and Patiño, as well as with other top politicians, including Fernando Cordero, head of Ecuador's legislature. Both Patiño and Ms Assange appeared visibly touched during a press conference, which had to be briefly suspended when Ms Assange started crying.

Ms Assange held several public meetings in government buildings, and in one instance she was accompanied by the head of her son's defence team, Baltasar Garzón, the former Spanish judge who ordered the London arrest of Chile's General Pinochet.

Other top political figures in Ecuador have been vocal about the government's support of Assange's bid. "Our comrade the president, who leads our international policy, will grant Julian Assange asylum," said María Augusta Calle, a congresswoman of the president's party, and former head of the Sovereignty, Foreign Affairs and Latin American Integration Commission during the 2008 Constitutional Assembly, during a meeting with Ms Assange.

Over the past year and a half, Assange has remained in touch with Ecuador's embassy in London. In April, he interviewed President Correa for his TV show on Russia Today, the English-language channel funded by the Russian government. The interview, which lasted 75 minutes, included a pally exchange in which Assange and Correa bonded over freedom of speech and the negative role of the US in Latin America. At one point Correa joked: "Are you having a lot of fun with the interview, Julian?" Assange replied: "I'm enjoying your jokes a great deal, yes."

Correa has made international headlines this year for what critics have called a government crackdown on private media. Analysts say that granting the WikiLeaks founder asylum could be a way for him to depict himself as a champion of freedom of speech ahead of the February 2013 presidential elections, in which he is expected to run again.