Brazil  (/brəˈzɪl/ (Portuguese: Brasil, IPA: [bɾaˈziw]), officially the Federative Republic of Brazil (Portuguese: República Federativa do Brasil,  listen), is the largest country in both South America and the Latin America region. It is the world's fifth largest country, both by geographical area and by population, with over 193 million people. It is the largest Lusophone country in the world, and the only one in the Americas. 
Bounded by the Atlantic Ocean on the east, Brazil has a coastline of 7,491 km (4,655 mi). It is bordered on the north by Venezuela, Guyana, Suriname and the French overseas region of French Guiana; on the northwest by Colombia; on the west by Bolivia and Peru; on the southwest by Argentina and Paraguay and on the south by Uruguay. Numerous archipelagos form part of Brazilian territory, such as Fernando de Noronha, Rocas Atoll, Saint Peter and Paul Rocks, and Trindade and Martim Vaz. It borders all other South American countries except Ecuador and Chile.
Brazil was a colony of Portugal beginning from the landing of Pedro Álvares Cabral in 1500, up until 1815, when it was elevated to the rank of kingdom upon the formation of the United Kingdom of Portugal, Brazil and the Algarves. The colonial bond was in fact broken several years earlier, in 1808, when the capital of the Portuguese colonial empire was transferred from Lisbon to Rio de Janeiro, after Napoleon invaded Portugal. Independence was achieved in 1822 with the formation of the Empire of Brazil, a unitary state governed under a constitutional monarchy and a parliamentary system. The country became a presidential republic in 1889, when a military coup d'état proclaimed the Republic, although the bicameral legislature, now called Congress, dates back to the ratification of the first constitution in 1824. Its current Constitution, formulated in 1988, defines Brazil as a federal republic. The Federation is formed by the union of the Federal District, the 26 States, and the 5,564 Municipalities. 
The Brazilian economy is the world's seventh largest by nominal GDP and the seventh largest by purchasing power parity, as of 2012. A member of the BRIC group, Brazil has one of the world's fastest growing major economies, and its economic reforms have given the country new international recognition and influence. Brazil is a founding member of the United Nations, the G20, CPLP, Latin Union, the Organization of Ibero-American States, the Organization of American States, Mercosul and the Union of South American Nations. Brazil is one of 17 megadiverse countries, home to a variety of wildlife, natural environments, and extensive natural resources in a variety of protected habitats. Brazil is considered a middle power in international affairs, and has been identified as an emerging power. 
The word "Brazil" comes from brazilwood, a tree that once grew plentifully along the Brazilian coast. In Portuguese, brazilwood is called pau-brasil, with the word brasil commonly given the etymology "red like an ember", formed from Latin brasa ("ember") and the suffix -il (from -iculum or -ilium). As brazilwood produces a deep red dye, it was highly valued by the European cloth industry and was the earliest commercially exploited product from Brazil. Through the 16th century, massive amounts of brazilwood were harvested by indigenous peoples (mostly Tupi) along the Brazilian coast, who sold the timber to European traders (mostly Portuguese, but also French) in return for assorted European consumer goods. 
The official name of the land, in original Portuguese records, was the "Land of the Holy Cross" (Terra da Santa Cruz), but European sailors and merchants commonly called it simply the "Land of Brazil" (Terra do Brasil) on account of the brazilwood trade. The popular appellation eclipsed and eventually supplanted the official name. Early sailors sometimes also called it the "Land of Parrots" (Terra di Papaga).
In the Guarani language, an official language of Paraguay, Brazil is called "Pindorama". This was the name the natives gave to the region, meaning "land of the palm trees".
Portuguese colonization
The land now called Brazil was claimed by Portugal in April 1500, on the arrival of the Portuguese fleet commanded by Pedro Álvares Cabral. The Portuguese encountered stone age natives divided into several tribes, most of whom spoke languages of the Tupi–Guarani family, and fought among themselves. Though the first settlement was founded in 1532, colonization was effectively begun in 1534, when King Dom João III of Portugal divided the territory into twelve hereditary captaincies. 
This arrangement proved problematic, and in 1549 the king assigned a Governor-General to administer the entire colony. The Portuguese assimilated some of the native tribes while others were enslaved or exterminated in long wars or by European diseases to which they had no immunity. By the mid-16th century, sugar had become Brazil's most important export and the Portuguese imported African slaves to cope with the increasing international demand. 
Through wars against the French, the Portuguese slowly expanded their territory to the southeast, taking Rio de Janeiro in 1567, and to the northwest, taking São Luís in 1615. They sent military expeditions to the Amazon rainforest and conquered British and Dutch strongholds, founding villages and forts from 1669. In 1680 they reached the far south and founded Sacramento on the bank of the Rio de la Plata, in the Eastern Bank region. 
At the end of the 17th century, sugar exports started to decline but beginning in the 1690s, the discovery of gold by explorers in the region that would later be called Minas Gerais in current Mato Grosso and Goiás, saved the colony from imminent collapse. From all over Brazil, as well as from Portugal, thousands of immigrants went to the mines. The Spanish tried to prevent Portuguese expansion into the territory that belonged to them according to the 1494 Treaty of Tordesillas, and succeeded in conquering the Eastern Bank in 1777. However, this was in vain as the Treaty of San Ildefonso, signed in the same year, confirmed Portuguese sovereignty over all lands proceeding from its territorial expansion, thus creating most of the current Brazilian borders. 
In 1808, the Portuguese royal family and the majority of the Portuguese nobility, fleeing the troops of the French Emperor Napoleon I that were invading Portugal and most of Central Europe, established themselves in the city of Rio de Janeiro, which thus became the seat of the entire Portuguese Empire. In 1815 Dom João VI, then regent on behalf of his incapacitated mother, elevated Brazil from colony to sovereign Kingdom united with Portugal. In 1809 the Portuguese invaded French Guiana (which was returned to France in 1817) and in 1816 the Eastern Bank, subsequently renamed Cisplatina. 
Independence and empire
After the Portuguese military had successfully repelled Napoleon's invasion of Portugal, João VI returned to Europe in April 1821, leaving his elder son Prince Pedro de Alcântara as regent to rule Brazil. The Portuguese government, guided by the new political regime imposed by the Liberal Revolution of 1820, attempted to turn Brazil into a colony once again, thus depriving it of its achievements since 1808. The Brazilians refused to yield and Prince Pedro stood by them declaring the country's independence from Portugal on 7 September 1822. 
On 12 October 1822, he was declared the first Emperor of Brazil and crowned Dom Pedro I on 1 December 1822. At that time most Brazilians were in favour of a monarchy and republicanism had little support. The subsequent Brazilian War of Independence spread through almost the entire territory, with battles in the northern, northeastern, and southern regions. The last Portuguese soldiers surrendered on 8 March 1824 and independence was recognized by Portugal on 29 August 1825. 
Pedro I abdicated on 7 April 1831 and went to Europe to reclaim his daughter's crown which had been usurped by his brother, leaving behind his five-year-old son and heir, who became Dom Pedro II. As the new emperor could not exert his constitutional powers until he reached maturity, a regency was created. Disputes between political factions led to rebellions and an unstable, almost anarchical, regency. The rebellious factions, however, were not in revolt against the monarchy, even though some declared the secession of the provinces as independent republics, but only so long as Pedro II was a minor. Because of this, he was prematurely declared of age and "Brazil was to enjoy nearly half a century of internal peace and rapid material progress." 
Despite the loss of Cisplatina in 1828 when it became an independent nation known as Uruguay, Brazil won three international wars during the 58-year reign of Pedro II (the Platine War, the Uruguayan War and the Paraguayan War) and witnessed the consolidation of representative democracy, mainly because of successive elections and unrestricted freedom of the press. Most importantly, slavery was extinguished after a slow but steady process that began with the end of the international traffic in slaves in 1850 and ended with the complete abolition of slavery in 1888. The slave population had been in decline since Brazil's independence: in 1823, 29% of the Brazilian population were slaves but by 1887 this had fallen to 5%.
When the monarchy was overthrown on 15 November 1889 there was little desire in Brazil to change the form of government and Pedro II was at the height of his popularity among his subjects. However, he "bore prime, perhaps sole, responsibility for his own overthrow." After the death of his two sons, the Emperor believed that "the imperial regime was destined to end with him." He cared little for the regime's fate and so neither did anything, nor allowed anyone else to do anything, to prevent the military coup, backed by former slave owners who resented the abolition of slavery. 
Early republic
The "early republican government was little more than a military dictatorship, with army dominating affairs both at Rio de Janeiro and in the states. Freedom of the press disappeared and elections were controlled by those in power". In 1894, following several military and economic crises, the republican civilians rose to power. 
Little by little, a cycle of general instability sparked by these crises undermined the regime in a such extent, that by 1930 in the wake of the murder of his running mate, it was possible for the defeated opposition presidential candidate Getúlio Vargas supported by most of the military, led a successful revolt. Vargas was supposed to assume power temporarily, but instead closed the Congress, extinguished the Constitution, ruled with emergency powers and replaced the states' governors with his supporters. Between 1932 and 1938, 3 major attempts to remove Vargas from power occurred. The second one being the 1935 communist revolt which served as an excuse for the preclusion of elections, put into effect by a coup d'état in 1937, which made the Vargas regime a full dictatorship, noted for its brutality and censorship of the press. 
In foreign policy, the success in resolving border disputes with neighboring countries in the early years of the republican period, was followed by a failed attempt to exert a prominent role in the League of Nations, after its involvement in World War I. In World War II Brazil remained neutral until August 1942, when the country entered in that war on the allied side, after suffer retaliations undertaken by Nazi Germany and Fascist Italy, due the country have severed diplomatic relations with them in the wake of Pan-American Conference. 
With the allied victory in 1945 and the end of the Nazi-fascist regimes in Europe, Vargas's position became unsustainable and he was swiftly overthrown in another military coup, being the Democracy "reinstated" by the same army that had discontinued it 15 years before. Vargas committed suicide in August 1954 amid a political crisis, after having returned to power by election in 1950. 
Contemporary era
Several brief interim governments succeeded after Vargas's suicide. Juscelino Kubitscheck became president in 1956 and assumed a conciliatory posture towards the political opposition that allowed him to govern without major crises. The economy and industrial sector grew remarkably, but his greatest achievement was the construction of the new capital city of Brasília, inaugurated in 1960.