Question: Over how many centuries did it take to form the country of Peru?
About the article "Peru", section "Demographics".

Candidate passages:
In 1532, the Spanish conquistadores arrived in Peru.
As they began to conquer the country, their culture and influence spread throughout the nation.
Not only did their ideology spread, their population did as well.
Over the period of the Peruvian colonial era, hundreds of thousands of Spanish immigrants flooded into Peruvian ports.
These Spanish-born immigrants, called "Peninsulares", caused much friction between themselves and the locally born Spanish criollos or creoles.
The peninsulares had a distinctly higher social rank than the criollos even though their only difference was their place of birth.
The peninsulares were given the highest governing positions, while the criollos, although much more wealthy than the mestizos and amerindians, did not receive all of the privileges given to the Spain-born Spanish.
This would eventually lead to the independence movement in the early 19th century.
During the colonial period, the Spanish crown disallowed the immigration of other Europeans to Peru.
For this reason, throughout the entire colonial period, up until independence, the European population in Peru was made up solely of Spaniards.
Around the time of independence the rate of immigration was low and not many Europeans were entering the country.
The nation was, in essence, in a state of chaos, for the reason that the government was still in the process of deciding how it would rule the newly independent country.
At this time, many caudillos, or dictators, attempted to assume control of the nation.
Some of these attempts, such as that of Simón Bolívar, were met with approval from the public, while others were not.
Spanish immigration did not resume until the 1840s at the beginning of the Guano era, one of Peru's most prosperous time periods.
During this era, immigration from Spain greatly increased and the economy was booming and standard of living was high.
This era ended in 1866 with the Spanish-Peruvian War in which Peru emerged victorious.
After the war, immigration decreased although the influx of immigrants remained steady until the 1930s.
During the Spanish Civil War, thousands of Spaniards fled from Spain to Peru.
Over the course of General Francisco Franco's dictatorship many thousands more fled in fear of the regime.
The Spanish republicans fled Franco's regime as well, seeking to escape retribution from the new government.
World War II brought the end of Spanish immigration to Peru.
Many Spanish Peruvians left the nation in 1960s and 1970s to flee from excessive poverty and dictatorship of Gen. Juan Velasco Alvarado and most of these moved to United States and Spain, while most of the rest to Canada, Australia, New Zealand, and United Kingdom.
The second wave of Spanish and other white Peruvians left during the Alan Garcia regime (a Hispanic descendant) that led Peru to extreme poverty and hyperinflation.
Nevertheless immigration from Spain began again in considerable numbers throughout the 20th century due to many Spanish tourists settling in Peru. 
Meanwhile, Simón Bolívar, who is considered by many to be the Napoleon of South America, and José de San Martín were endeavoring to free the surrounding territories in Latin America.
San Martín, who was originally from Argentina, had liberated Chile and then moved on to Peru.
Martín believed that to completely eliminate Spanish rule in Latin America they had to defeat the Royalists in Peru.
Upper Peru was then under the Viceroyalty of Lima and thus liberating Peru would lead to the liberation of Upper Peru as well.
Therefore, because of this strong conviction that as long as Spain controlled the seas they would have a foothold on the continent, he created a fleet lead by Lord Cochrane, who had joined the Chilean service in 1819.
Martín took over Lima in July 1821 and declared Peruvian independence.
There Martín encountered much resistance from the Royalists who remained.
During that time his army began to crumple because of disease as well as soldiers abandoning the army.
Martín was left with no choice but to beg Bolívar for his help.
Although Bolívar and Martín met, they could not agree on the form of government that should be established for the liberated countries and so both went on their separate ways for the time being.
Martín returned to Peru, only to face the a revolution in Lima that had started because the men left behind were incapable of governing the country.
He resigned from his position as Protector of Peru, discouraged.
Bolívar was convinced that it was his duty to rid the continent of the Spanish, and so journeyed to Lima.
When he arrived on September 1 of 1823 he immediately took command.
The fight for independence gained new impetus after the December 9, 1824, Battle of Ayacucho in which a combined army of 5,700 Gran Colombian and Peruvian troops under the command of Antonio José de Sucre defeated the royalist army of 6,500 and captured its leader, José de la Serna.</ref>However, Royalist armies still remained, which were the stronghold at El Callao and the army of General Olañeta in Upper Peru.
The army at El Callao was easily defeated but Olañeta’s army proved to be more difficult.
Olañeta was rumored to have planned to surrender Upper Peru to Brazil in 1824 in order to keep the country under Spanish control.
He had asked for Brazil to send over an army, however the governor of Brazil refused to become involved.
Bolívar and San Martín both desired to make an agreement with Olañeta because he had helped them in the battle of Ayacucho.
Sucre, Bolívar’s most successful general, did not trust Olañeta and so despite his plan to make peace, he started to occupy Upper Peru.
Sucre prepared to persuade this Royalist general, either with works or by force.
Bolívar assumed that Olañeta would take a long time deciding what to do and planned to travel to Upper Peru during that time.
However, Olañeta had planned one more sudden attack.
Sucre invited the men of Upper Peru to join him and in January 1825, a large number of men from Olañeta’s army deserted him and joined Sucre.
On March 9, Sucre had succeeded in capturing every Royalist general there except for Olañeta.
Yet this fierce general refused to surrender.
Finally on April 13, Olañeta and Sucre met in battle and Olañeta was fatally wounded.
At last Spain had relinquished its grip on South America, the final battles being fought in Upper Peru.“Sucre called this city the cradle of American Independence.” The reason for this statement lay in the fact that La Paz was the first place people were murdered for the desire for independence and now, decades later, the last Royalist forces had been defeated.
What remained of the royalist forces dissolved because of mutiny and desertion.
On April 25, 1825 Sucre stepped foot in Chuquisaca, which had been the hub of Spanish dominion.
The citizens of the city rejoiced, gathering along the road.
The town council, clergy, and the university students all congregated at the edge of Chuquisaca to greet Sucre.
The people even went as far as preparing a Roman chariot pulled by twelve maidens dressed in blue and white to pull Sucre into the heart of the city.
Sucre called a meeting on July 10 in Chuquisaca to decide the fate of the country of Upper Peru.
There were three options that the committee could decide from.
Upper Peru could either, unite with Argentina, unite with Peru, or it could become independent.
Bolívar’s desire was for Upper Peru to unite with Peru, however the council was in favor of becoming an independent nation.
Although they did not all vote for this, all signed the declaration of independence on August 6, 1825.
Although no one disputes that fact that Bolivia was named after Bolívar.
there are differences in opinion over why that actually happened.
Some historians say that it is because the people were afraid Bolívar would be against the vote because Bolívar wanted Upper Peru to join Peru.
Because of this, they proceeded to name the newly formed country after him to appease him.
The Bolivian population still celebrates Bolívar’s birthday as a national holiday to honor him.
Bolívar was president for five months, during which time he reduced taxes, and reformed the land organization to aid the indigenous population.
He left Sucre as president when he returned to govern the North.
Sucre attempted to reduce the taxes that the indigenous were forced to pay.
However, this plan failed because without it, he was not able to support the Gran Colombian Army which stopped the Argentinians from invading Bolivia again.
Thus the system remained in place.
From then on, local elites dominated the congress and although they supported Sucre's efforts, they chafed under the idea that a Gran Colombian army remained in the nation.
After an attempt on his life, Sucre resigned the presidency of Bolivia in April 1828 and returned to Venezuela.
The Bolivian Congress elected La Paz native Andrés de Santa Cruz the new president.
Santa Cruz had been a former royalist officer, served under José de San Martín after 1821 and then under Sucre in Ecuador, and had a short term as president of Peru from 1826 to 1827.
Santa Cruz arrived in Bolivia in May 1829 and assumed office.
Independence did not provide solidarity to the nation.
For six decades afterward the country had feeble and short governing institutions1. 
Indians in Peru form a tiny minority in the country.
The first immigrants from India to have arrived in Peru were businessmen who had gone there in the early 1960s.
Later on, the community grew in number marginally until the early 80s, after which many of its members left due to the severe local economic crises and the prevailing terrorism.
An estimated 10,000 Palestinians live in Peru alone, many of these families who arrived after the first Israel wars in 1948-49 had reestablished and bettered themselves in Peru when it comes to socioeconomic status. 
The formation of large, united South American nations was a popular idea that Simón Bolívar and a series of other prominent leaders of that time sought to form.
Nonetheless, the problems began when the leaders could not agree where the center of power of this union would be located.
Many of the leaders would soon figure that this union would not happen, and many (such as José de San Martín) went back to their regular lives in disappointment.
Yet, in order to expand his personal dream of Gran Colombia, Bolívar allowed Sucre to form the nation of Bolivia in Upper Peru.
This action led to much controversy as the republican government of Peru sought to re-consolidate its power in a region that had belonged to them under the Spanish authorities.
This period of time was filled with much political intrigue, and soon a war erupted between Peru and Gran Colombia.
The political turmoil in Peru stopped Bolivar's plans to reach Bolivia and keep expanding Colombia, but the warfare ended indecisively.
The aftermath of this left Peru consolidated as a state, Bolivia formally recognized as a separate entity by Peru, and the beginning of the dissolution of Gran Colombia into the nations of the New Granada (today, Colombia), Ecuador, and Venezuela.
Even though Peru had recognized the independence of Bolivia, the national sentiment among the Peruvian society and its politicians greatly influenced the events that would soon take place.
Agustin Gamarra and Andres de Santa Cruz were the leading proponents of a union between these two nations during the 1830s, but each had different views on which nation would command the union.
While Santa Cruz favored a Bolivian-led confederation, Gamarra sought to annex Bolivia into Peru.
A series of political conflicts in Peru would soon give Santa Cruz the chance to start his plans, and led an invasion of Peru claiming his intentions were to restore order.
A series of Peruvians felt betrayed by their own government as the president and several leaders of congress allowed Santa Cruz to divide Peru into two nations: North Peru and South Peru.
The Peru-Bolivian Confederation was soon formed, and several leading powers of the day (Such as France and Great Britain) and the United States recognized the nation's existence.
Politicians in South America would also form divided opinions about this new nation, but due to the political conflicts in the former states of the Greater Colombia, the main turmoil to this idea centered in Southern South America.
Among the most heavily involved in this situation was the Republic of Chile.
Famous Chilean leaders such as Bernardo O'Higgins and Ramon Freire openly favored the ideas of the newly self-appointed "Grand Marshal" Santa Cruz, but at the same time they opposed the regime that at that moment governed Chile.
The government in Chile was also deeply divided as to what they should do about this new nation.
A series of Peruvians, including Agustin Gamarra and Ramon Castilla, saw the situation as an invasion of Bolivia into Peruvian territory, and they went into exile in Chile in order gain support from the Chilean government.
Nevertheless, as far as things concerned Chile, Peru still owed a debt to the Chilean government as a result of this government helping in the liberation of Peru from Spain, and both nations were still under a commercial competition as to which port would become the most important in the southern Pacific coasts (Callao in Peru or Valparaíso in Chile).
Moreover, Chile saw the creation of this new Peru-Bolivia government as a threat to Chilean independence and sovereignty due to the major influence that the combined territories of Peru and Bolivia were beginning to form in the world, and the many important Chilean figures exiled in Peru that sought to take over and change the current Chilean governmental administration.
Even though the Peru-Bolivian Confederation was still very young, the economic and infrastructure plans of Grand Marshal Santa Cruz had made a major impact in the economy of Bolivia, and the nation of South Peru also began to greatly benefit as a result of being free from the control of Lima and staying under the economic policies of Santa Cruz.
The only state from this union that did not truly benefit was North Peru, and soon this state would begin to provide the greatest support for Chilean intervention into this situation. 
After winning independence from Spain Peru was financially strapped.
Over the years financial woes worsened and Peru needed money.
In 1865 then 1866, bonds were issued that were retired with new bonds in 1869.
More bonds were issued in 1870 but the 1869 bonds were not addressed.
New bonds were again issued in 1872 and again previous bonds were not addressed.
A major problem, that would take many years to resolve, was that the rich guano deposits were used as security on all the bonds.
Peru struggled to make bond interest payments but on December 18, 1875, Peru defaulted.
The War of the Pacific (1879–1883) made matters far worse and by 1889 the country had to do something.
In London a group formed the Peruvian Corporation to try to resolve the issues and recoup invested money.
The objectives of the company were extensive.
They included the acquisition of real or personal property in Peru or elsewhere, dealing in land, produce, and property of all kinds, constructing and managing railways, roads, and telegraphs, and carrying on the business usually carried on by railway companies, canal companies, and telegraph companies.
It also was involved in constructing and managing docks and harbours, ships, mines, beds of nitrates, managing the State domains, and acting as agents of the Peruvian Government.