Panama exists because of geography. The Isthmus of Panama narrows to 50 kilometers at its thinnest point, connecting continents that split apart roughly 3 million years ago when the landbridge rose from the sea. This event, called the Great American Biotic Interchange, allowed species to migrate between North and South America while permanently altering ocean currents and global climate patterns. The land created a barrier between the Atlantic and Pacific that would define every subsequent chapter of human activity in this place.
Indigenous peoples occupied the isthmus for at least 11,000 years before European contact. Archaeological evidence from the Monagrillo site on the Azuero Peninsula dates ceramic production to approximately 2500 BCE, among the earliest pottery traditions in the Americas. By the time Spanish ships arrived, distinct groups occupied different ecological zones. The Cueva people inhabited the central and eastern regions. The Chibchan-speaking groups controlled western highlands. Coastal communities fished and traded. Population estimates for pre-Columbian Panama range from 500,000 to 2 million, though no consensus exists among scholars. These societies developed agriculture based on maize, manioc, and root crops, supplemented by marine resources and forest game.
Rodrigo de Bastidas became the first European to explore Panama's Caribbean coast in 1501, sailing west from Venezuela. Christopher Columbus arrived during his fourth voyage in 1502, establishing a short-lived settlement at Santa María la Antigua del Darién in what is now the Darién Gap region. The colony failed within months due to disease and indigenous resistance. Vasco Núñez de Balboa led an expedition westward from Darién in September 1513 with approximately 190 Spaniards and several hundred indigenous allies. On September 25, 1513, Balboa reached the Pacific Ocean, which he named the South Sea. He claimed all shores touched by this ocean for the Spanish Crown. This crossing required 25 days through jungle that remains largely impassable today.
The Spanish founded Panama City on August 15, 1519, on the Pacific coast. The location served as the Pacific terminus for transporting Peruvian silver and other South American wealth to the Caribbean, where it transferred to ships bound for Spain. This route, called the Camino Real and later supplemented by the Camino de Cruces, made Panama the pivot of Spain's colonial economy for three centuries. Portobelo on the Caribbean coast became the northern terminus, hosting trade fairs that attracted merchants from across the Spanish Empire. English privateer Henry Morgan attacked and burned Panama City in January 1671, leading to the city's reconstruction at a new site several kilometers southwest, the location now called Casco Viejo.
Indigenous populations collapsed under Spanish colonization. Disease killed many—smallpox, measles, and typhus spread through populations with no immunity. Forced labor in mines and on construction projects killed others. Spanish authorities established the encomienda system, granting colonists control over indigenous labor. Surviving communities retreated to remote mountains and jungles. The Guna moved to the San Blas Islands beginning in the 19th century after conflicts with Spanish and later Colombian authorities. The Ngäbe and Buglé remained in the western highlands of Chiriquí and Veraguas provinces. The Emberá and Wounaan maintained territories in the Darién region, their semi-nomadic riverine lifestyle providing some protection from colonial control.
Spain imported enslaved Africans to Panama beginning in the early 1500s. Ships unloaded human cargo at Portobelo, where some remained as laborers while others crossed the isthmus for sale in Peru and other Pacific destinations. Escaped slaves, called cimarrones, established independent settlements in the jungle, particularly in the Darién. Some cimarrones allied with English and French pirates raiding Spanish supply routes. After independence, Afro-Panamanians formed a significant portion of the population in Colón Province, Bocas del Toro, and the former Canal Zone.
Panama remained part of the Viceroyalty of Peru until 1717, when Spain transferred it to the Viceroyalty of New Granada, administered from Bogotá. The region gained independence from Spain on November 28, 1821, immediately joining Simón Bolívar's Gran Colombia. When Gran Colombia dissolved in 1831, Panama became a province of the Republic of New Granada, later renamed Colombia. Panama attempted separation from Colombia several times during the 19th century. An 1840 rebellion achieved brief autonomy. The Thousand Days' War from 1899 to 1902 devastated the isthmus, with guerrilla leader Victoriano Lorenzo leading indigenous and mestizo forces before his execution by firing squad in 1903.
The United States intervened in Colombian affairs to secure rights to build a canal. France had attempted construction from 1881 to 1889 under Ferdinand de Lesseps, the Suez Canal engineer, but abandoned the project after approximately 22,000 workers died from yellow fever, malaria, and accidents, and costs exceeded financing. The United States negotiated with Colombia for canal rights, but the Colombian Senate rejected the Hay-Herrán Treaty in August 1903. Panamanian separatists, supported by the United States, declared independence on November 3, 1903. The USS Nashville prevented Colombian troops from crossing the isthmus to suppress the rebellion. The United States recognized Panamanian independence on November 6, 1903. On November 18, 1903, the new Panamanian government signed the Hay-Bunau-Varilla Treaty, granting the United States control over a 16-kilometer-wide Canal Zone in perpetuity in exchange for $10 million plus annual payments of $250,000 beginning in 1912.
Canal construction under American direction began in 1904. Colonel William Gorgas directed mosquito eradication programs that reduced yellow fever and malaria transmission, enabling work to proceed. Chief engineer John Stevens reorganized the project from 1905 to 1907, establishing railroad systems and housing. George Goethals directed final construction from 1907 to 1914. Approximately 56,000 workers labored on the project at peak employment. The workforce included laborers from Barbados, Jamaica, Martinique, Guadeloupe, China, Europe, and the United States. Workers excavated roughly 230 million cubic meters of material. The Culebra Cut through the Continental Divide required removing approximately 100 million cubic meters of rock and earth. Gatún Dam created Lake Gatún, at the time the largest artificial lake in the world, covering 425 square kilometers. The canal opened to traffic on August 15, 1914, when the SS Ancon completed the first official transit.
The Canal Zone operated as American territory within Panama until 1979. Approximately 60,000 U.S. citizens lived in the Zone at peak population, creating a separate society with its own schools, courts, postal system, and currency. Panamanians could work in the Zone but could not reside there except as domestic employees. This arrangement created resentment. On January 9, 1964, students from Balboa High School removed a Panamanian flag raised beside the American flag at their campus. Riots erupted in Panama City and the Canal Zone. Fighting continued for four days, killing 22 Panamanians and 4 American soldiers. Panama broke diplomatic relations with the United States. The incident, known in Panama as Día de los Mártires, forced negotiations toward new arrangements.
General Omar Torrijos seized power in a 1968 coup, establishing a military government that would control Panama for 21 years. Torrijos positioned himself as a populist nationalist, expanding rural education and healthcare while maintaining strict political control. He negotiated the Torrijos-Carter Treaties signed on September 7, 1977. These treaties terminated the 1903 agreement and established a timeline for transferring canal control to Panama. The Panama Canal Treaty gave the United States operating rights until December 31, 1999, at noon. The Neutrality Treaty guaranteed permanent neutral status for the canal. The U.S. Senate ratified both treaties by 68 to 32 votes in March and April 1978, one vote more than the required two-thirds majority. Torrijos died in a plane crash on July 31, 1981, in western Panama. The cause remains disputed—official investigation concluded pilot error, but some Panamanians maintain the crash was assassination.