The early part of the twentieth century was marked by a drawn-out civilian dictatorship headed by President Augusto B. Leguia. The project to modernize the country, creating works for a New Fatherland left the State heavily in debt and unable to deal with the 1929 crash. It was also a time of intellectual creativity, symbolized by the founder of the APRA party, Victor Raul Haya de la Torre and Jose Carlos Mariategui, the father of Socialist beliefs in Peru and the center of intellectual and artistic thinking in the country during his short life.
After the fall of Leguia, military regimes once again rose to the forefront, despite apparently having run their course with the presidencies of Prado in 1939 and Bustamante y Rivero in 1945; but in 1948 a new military government was formed by Manuel A. Odria. Over the next eight years, major public works were built amidst severe political repression.
Peru, which has made major efforts to forge friendly relations with neighboring countries, has managed to overcome long-running border conflicts. Navigation conditions along the Amazon River led to agreements with Brazil, until in 1909 the frontier between the two nations was finally established. After lengthy debate, the border treaty with Colombia was approved by Congress in 1927, and Colombians were granted an access route to the Amazon River. In 1929, after border disputes with Chile resulting from armed conflict, the will to improve relations led both nations to sign a treaty whereby the city of Tacna was returned to Peru.
The border with Bolivia was marked by mutual accord in 1932. Finally, after several armed conflicts and diplomatic controversies with Ecuador, Peru in 1999 managed to get the 1942 Rio Protocol to prevail, closing the final chapter of the dispute over the territory within the Cordillera del Condor mountain range, shoring up Peru's relations with Ecuador.
In 1968, the armed forces staged a coup d'etat and overthrew then-President Fernando Belaunde. The first few years of the military regime stood out from other dictatorships in Latin America in that Peru's military had socialist sympathies. Led by General Juan Velasco, the military regime expanded the role of the State in a bid to solve the problems that had impoverished the country. Thus the State nationalized the oil industry, the media and carried out an agrarian reform. Velasco was replaced by General Francisco Morales-Bermudez, who bowed to public pressure and called for a Constituent Assembly.
Belaunde was re-elected in 1980, but the deep-lying poverty spurred the birth of two insurgencies which unleashed a wave of violence for over a decade. After the government of Alan Garcia (1985-1990), Alberto Fujimori was elected president in 1990, but shut down Congress in 1992 and decreed an emergency government. He was re-elected in 1995 and 2000, but public discontent forced him to call fresh elections for 2001. Valentin Paniagua was then chosen to head a caretaker government. In July 2001, Dr. Alejandro Toledo Manrique took office as the Constitutional President of the Republic of Peru.