What is now Ecuador formed part of the northern Inca Empire until the Spanish conquest in 1533. Quito became a seat of Spanish colonial government in 1563 and part of the Viceroyalty of New Granada in 1717. The territories of the Viceroyalty - New Granada (Colombia), Venezuela, and Quito - gained their independence between 1819 and 1822 and formed a federation known as Gran Colombia. When Quito withdrew in 1830, the traditional name was changed in favor of the "Republic of the Equator." Between 1904 and 1942, Ecuador lost territories in a series of conflicts with its neighbors. A border war with Peru that flared in 1995 was resolved in 1999. Although Ecuador marked 30 years of civilian governance in 2004, the period was marred by political instability. Protests in Quito contributed to the mid-term ouster of three of Ecuador's last four democratically elected presidents. In late 2008, voters approved a new constitution, Ecuador's 20th since gaining independence. General elections were held in February 2013, and voters reelected President Rafael CORREA.
Ecuador is substantially dependent on its petroleum resources, which have accounted for more than half of the country's export earnings and approximately 25% of public sector revenues in recent years.In 1999/2000, Ecuador's economy suffered from a banking crisis, with GDP contracting by 5.3% and poverty increasing significantly. In March 2000, the Congress approved a series of structural reforms that also provided for the adoption of the US dollar as legal tender. Dollarization stabilized the economy, and positive growth returned in the years that followed, helped by high oil prices, remittances, and increased non-traditional exports. The economy grew an average of 4.3% per year from 2002 to 2006, the highest five-year average in 25 years. After moderate growth in 2007, the economy reached a growth rate of 6.4% in 2008, buoyed by high global petroleum prices and increased public sector investment. President Rafael CORREA Delgado, who took office in January 2007, defaulted in December 2008 on Ecuador's sovereign debt, which, with a total face value of approximately US$3.2 billion, represented about 30% of Ecuador's public external debt. In May 2009, Ecuador bought back 91% of its "defaulted" bonds via an international reverse auction.Economic policies under the CORREA administration - for example, an announcement in late 2009 of its intention to terminate 13 bilateral investment treaties, including one with the US - have generated economic uncertainty and discouraged private investment. China has become Ecuador's largest foreign lender since Quito defaulted in 2008, allowing the government to maintain a high rate of social spending; Ecuador contracted with the Chinese government for more than $9.9 billion in forward oil sales, project financing, and budget support loans as of December 2013.The level of foreign investment in Ecuador continues to be one of the lowest in the region as a result of an unstable regulatory environment, weak rule of law, and the crowding-out effect of public investments. Faced with a 2013 trade deficit of $1.1 billion, Ecuador erected technical barriers to trade in December 2013, causing tensions with its largest trading partners. Ecuador also decriminalized intellectual property rights violations in February 2014. In March, 2015 Ecuador imposed tariff surcharges from 5% to 45% on an estimated 32% of imports. In 2014, oil output increased slightly and production remained steady in 2015 however the oil price decrease from 2014 onward affected government revenue. Ecuador’s economy fell in to recession in 2015 and remained in recession in 2016. As a result, CORREA cut the budget twice in 2015, and reduced it further in 2016.