Panama was densely inhabited by different indigenous peoples before the arrival of the Spanish. The first European sighting of Panama was by the Spaniard Rodrigo de Bastidas in 1501, and Columbus dropped anchor off the present-day Portobelo in 1502. Martín Fernández de Enciso and Diego de Niuesa failed in their efforts at colonization in Darién. Vasco Núñez de Balboa established the first successful colony in 1510 and became governor of the region. The indigenous population was soon devastated by the Spanish and by the diseases they carried from Europe.
In 1513, Balboa made his momentous voyage across the isthmus to the Pacific, thus highlighting the dominant factor in the nation's history—the short distance from sea to sea. Under the governorship of Pedro Arias de Ávila, Panama City was founded (1519). Soon the isthmus became the route by which the treasures of the Inca empire were transferred to Spain, attracting the unwelcome attention of English buccaneers—such as Sir Francis Drake, William Parker, Sir Henry Morgan, and Edward Vernon—who swooped down on the gold-bearing galleons and the treasures of Portobelo. Panama was subordinated to the viceroyalty of Peru and remained in this status until 1717, when it was transferred to New Granada.
Attempts at Scottish settlement in the Darién Scheme of the 17th cent. failed wretchedly. With the decline of the Spanish Empire, Panama lost much of its importance in the carrying trade. Panama became a part of independent Colombia in 1821. Its significance as a crossroad was enhanced again when U.S. settlers bound for Oregon and the goldfields of California passed through Panama. W. H. Aspinall built (1848–55) the Panama RR, and the question of a canal across the isthmus became paramount. The project ultimately led to a revolution against Colombian sovereignty and the establishment of Panama as a separate republic (see Panama Canal).
The new state, proclaimed in Nov., 1903, was under the aegis of the United States, and the canal and American interests in it became the determinants of Panama's history. The Hay–Bunau-Varilla Treaty with the United States established the Panama Canal Zone, controlled by the United States, and authorized U.S. intervention in Panamanian affairs if necessary to protect the zone. The internal politics of the republic have been stormy, with frequent changes of administration. U.S. forces were landed in 1908, 1912, and 1918. A controversial figure in Panamanian politics was Arnulfo Arias who was elected president in 1940 and ousted a year later for being pro-Fascist. He seized power in 1949 but was overthrown in 1951. José Antonio Remón, elected in 1952, was assassinated in 1955; Ernesto de la Guardia, Jr., inaugurated the following year, survived disturbances in 1958 and 1959.
In the meantime, a new canal treaty was concluded in 1955, as political unrest developed in Panama over the Canal Zone issue. In 1958 and again in 1960 further steps were taken to assuage Panamanian discontent by establishing uniform wages and employment opportunities in the Canal Zone and by reaffirming Panama's titular sovereignty over the zone. Roberto F. Chiari, a conservative landowner, was elected president in 1960. Marco A. Robles defeated Arias for the presidency in 1964. When U.S. high-school students illegally displayed an American flag in the Canal Zone (Jan., 1964), serious riots broke out. Diplomatic relations between Panama and the United States were briefly suspended. New treaties were negotiated (1967), providing for Panamanian sovereignty over the Canal Zone, joint operation of the canal, and possible construction of a new, sea-level canal, but Panama refused to ratify them (1970).
In early 1974 Panama and the United States agreed in principle for the first time to the eventual end of U.S. jurisdiction over the canal and the Canal Zone. Arias was again elected president in Oct., 1968, but was deposed 11 days later in a military coup. Gen. Omar Torrijos Herrera emerged as the dominant figure shortly thereafter. Torrijos conducted enormous public works projects that gained him considerable popularity while plunging the country into debt. In 1977, he concluded a treaty with the United States that provided for a gradual transfer of jurisdiction over the Canal Zone and the canal to Panama by the end of 1999. A second treaty guaranteed the permanent neutrality of the canal.
After the death of Torrijos in a plane crash in 1981, Colonel Manuel Antonio Noriega Moreno slowly gained power, and in 1983 he took complete control of the national guard and of the country. Throughout the 1980s Noriega manipulated elections, ruling Panama through presidents who were mostly mere puppets. In 1987 a former officer of the Panamanian Defense Force (the expanded National Guard) publicly accused Noriega of ordering the murder of a prominent political opponent, manipulating election results, and engaging in drug smuggling with Colombian drug producers. As a result, the United States imposed strict sanctions that severely damaged Panama's economy and resulted in large protests against Noriega in Panama City.
On Dec. 15, 1989, the Panamanian legislature declared Noriega president and proclaimed that the United States and Panama were in a state of war. The same day a U.S. marine was killed by Panamanian soldiers. On Dec. 20, the United States attacked Panama City with a combined military force of more than 25,000 soldiers in an effort to remove Noriega from power.
Noriega surrendered on Jan. 3, 1990, and was taken to the United States, where he was later tried, convicted, and jailed on charges of drug trafficking. Guillermo Endara Galimany, elected to the presidency in May, 1989, but prevented by Noriega from taking office, was sworn into office during the invasion. The invasion resulted in considerable loss of life as well as significant damage to Panama City. In 1994, Ernesto Pérez Balladares, a former associate of Torrijos and the candidate of the political party that had once supported but later repudiated Noriega, won the presidential election. He introduced a sweeping economic reform plan and pledged to fight corruption and drug trafficking. In Oct., 1994, the constitution was amended to abolish Panama's military. Mireya Moscoso Rodríguez, a coffee company owner and the widow of Arnulfo Arias, was elected president in 1999. Martin Torrijos Espino, who had lost to Moscoso in 1999, was elected president in 2004. He is the son of Gen. Omar Torrijos. In 2006 Panamanian voters approved an expansion of the Panama Canal that would add an third, larger set of locks to the existing canal; construction is planned for 2008–14. The presidential election in May, 2009, was won by Ricardo Martinelli, one of Panama's wealthiest persons; a pro-business conservative, he was the candidate of the multiparty Alliance for Change.