The economic history of Brazil covers various economic events and traces the changes in the Brazilian economy over the course of the history of Brazil. Portugal, which first colonized the area in the 16th century, enforced a colonial pact with Brazil, an imperial mercantile policy, which drove development for the subsequent three centuries. Independence was achieved in 1822. Slavery was fully abolished in 1888. Important structural transformations began in the 1930s, when important steps were taken to change Brazil into a modern, industrialized economy. A socioeconomic transformation took place rapidly after World War II. In the 1940s, only 31.3% of Brazil's 41.2 million inhabitants resided in towns and cities; by 1991, of the country's 146.9 million inhabitants 75.5% lived in cities, and Brazil had two of the world's largest metropolitan centers: São Paulo and Rio de Janeiro. The share of the primary sector in the gross national product declined from 28% in 1947 to 11% in 1992. In the same 1947–92 period, the contribution of industry to GNP increased from less than 20–39%. The industrial sector produces a wide range of products for the domestic market and for export, including consumer goods, intermediate goods, and capital goods. Through the 1980s and 1990s, the Brazilian economy suffered from rampant inflation that subdued economic growth. After several failed economic initiatives created by the government, in 1994 the Plano Real was introduced. This plan brought stability and enabled Brazil to sustain economic growth over that of the global economy through the coming decade. Despite this rapid development the country still suffers from high levels of corruption, violent crime, functional illiteracy and poverty. Colonial period Brazil belonged to the Kingdom of Portugal as a colony. European commercial expansion of the fifteenth and sixteenth centuries. Blocked from the lucrative hinterland trade with the Far East, which was dominated by Italian cities, Portugal began in the early fifteenth century to search for other routes to the sources of goods valued in European markets. Portugal discovered the maritime passage to the East Indies around the southern tip of Africa and established a network of trade outposts throughout Africa and Asia. After the discovery of America, it competed with Spain in occupying the New World. Initially, the Portuguese did not find mineral riches in their American colony, but they never lost the hope of someday finding such riches there. Meanwhile, in order to settle and defend the colony