The embassy granted Assange asylum two months after he took refuge in its London embassy. The decision was made over fears that his human rights might be violated.
Announcing Ecuador's decision, the country's foreign minister Ricardo Patino said that he believed Assange's fears of political persecution were "legitimate".
He said that the country was staying true to its tradition of helping to protect the most vulnerable, and also accused the UK of making an "open threat" to enter the embassy to arrest the WikiLeaks founder.
However, Patino added: "We trust that our friendship with the United Kingdom will remain intact."
In June, Assange sought refuge in the embassy to avoid being extradited to Sweden, where he is facing questioning over assault and rape claims.
The Australian national described the decision by Ecuador to grant political asylum as a "significant victory" and also thanked staff at the London embassy.
But with the UK Foreign Office insisting that this would not affect its obligation to extradite him to Sweden, Assange warned that things were likely to get "more stressful".
The Foreign Office said that it was "disappointed" by Ecuador's decision.
"Under our law, with Mr Assange having exhausted all options of appeal, the British authorities are under a binding obligation to extradite him to Sweden," it said in a statement.
"We shall carry out that obligation. The Ecuadorian government's decision this afternoon does not change that."
The Foreign Office said it remained committed to reaching a "negotiated solution", but only if that allows it to carry its "obligations under the Extradition Act".
This means that Assange still faces arrest if he leaves the embassy.