But the Andean nation quickly dimissed the idea after officials accused him of breaking American laws.
"Ecuador is studying and analysing the request," Foreign Minister Ricardo Patino told reporters in Quito, the country's capital.
Twitter: Ricardo Patiño Aroca - Julian Assange ha solicitado asilo político en la misión diplomática del Ecuador en Londres. Gobierno ecuatoriano analiza su pedido
He said Mr Assange had written to President Rafael Correa saying he was being persecuted.
He said that Mr Assange had argued that "the authorities in his country will not defend his minimum guarantees in front of any government or ignore the obligation to protect a politically persecuted citizen."
He said it was impossible for him to return to his homeland because it would not protect him from being extradited to "a foreign country that applies the death penalty for the crime of espionage and sedition".
A message was posted on the Wikileaks Twitter account, saying: "ALERT: Julian Assange has requested political asylum and is under the protection of the Ecuadorian embassy in London."
Twitter: WikiLeaks - ALERT: Julian Assange has requested political asylum and is under the protection of the Ecuadorian embassy in London http://t.co/bz4O9bjF
A second read: "We will have more details on the Ecuadorian situation soon."
Embassy officials said Mr Assange had arrived at the embassy earlier on Tuesday and had requested political asylum. Mr Assange is said to be "under protection" at the embassy.
A statement issued on behalf of the embassy said: "This afternoon Mr Julian Assange arrived at the Ecuadorian Embassy seeking political asylum from the Ecuadorian government.
"As a signatory to the United Nations Universal Declaration for Human Rights, with an obligation to review all applications for asylum, we have immediately passed his application on to the relevant department in Quito.
"While the department assesses Mr Assange's application, Mr Assange will remain at the embassy, under the protection of the Ecuadorian Government."
"The decision to consider Mr Assange's application for protective asylum should in no way be interpreted as the Government of Ecuador interfering in the judicial processes of either the United Kingdom or Sweden.
"In order to reach a proper decision in line with international law on Mr Assange's application, the Ecuadorian government will be seeking the views of the governments of the United Kingdom, Sweden and the United States of America.
"The Ecuadorian government will consider all the representations carefully as it is obliged to do under the accepted process in assessing such applications." His lawyers declined to comment as they left Ecuador's embassy.
But in a statement, Mr Assange said: "I can confirm that today I arrived at the Ecuadorian Embassy and sought diplomatic sanctuary and political asylum. This application has been passed to the Ministry of Foreign Affairs in the capital Quito.
"I am grateful to the Ecuadorian ambassador and the government of Ecuador for considering my application."
Last month Mr Assange interviewed the country's President as part of his new television series The World Tomorrow.
The moves came after the British Supreme Court decided last month that extradition was lawful and could go ahead. But Mr Assange was given time to consider the judgment.
The Swedish authorities want him to answer accusations of raping a woman and sexually molesting and coercing another in Stockholm in August 2010 while on a visit to give a lecture.
His only legal recourse in Britain is a possible appeal to the European Court of Human Rights.
Mr Assange, whose WikiLeaks website has published a mass of leaked diplomatic cables that embarrassed several governments and international businesses, has argued the sex was consensual while the allegations were politically motivated.
His legal struggle to stay in Britain has dragged on for the better part of two years, clouding his website's work exposing the world's secrets.
Australian authorities have cooperated with the United States in investigating WikiLeaks' conduct. The local government has concluded that Assange has broken no Australian law.
The former computer hacker gained international prominence in 2010 when WikiLeaks began releasing secret video footage and thousands of U.S. diplomatic cables, many of them about Iraq and Afghanistan.
It was considered the largest leak of classified documents in American history.
Mr Assange, who has not been charged with any offenses in Sweden and denies any wrongdoing, was on bail and living with friends before his extradition.
The Swedish Prosecution Authority said it had no information on the development.