The early history of Panama encompasses pre-contact Indigenous civilization and the subsequent era of European colonization. Archaeological evidence reveals sophisticated pre-Columbian societies, including Uto-Aztecan communities and advanced agricultural settlements.

When Spanish settlers first arrived, the Isthmus of Panama was home to numerous Indigenous groups, with the Guna people alone estimated at 750,000 individuals. Spanish colonization began in 1501 with Rodrigo de Bastidas, followed by Christopher Columbus and Vasco Núñez de Balboa, who found the Pacific Ocean in 1513.

Under Spanish colonial rule, Panama became a crucial transit point for Peruvian gold and silver, though this period was marked by significant Indigenous population decline and assimilation, the introduction of African enslaved people, and the emergence of maroon communities. The route became known as the Camino Real de Portobelo, or Royal Road of Portobelo, although it was more commonly known as Camino Real de Cruces (Royal Road of the Crosses) because the road led to the Town of Venta Cruces located on the Rio Chagres. The Spanish established strict control over trade through Panama, making it one of only three authorized ports in Spanish America for trade with Spain, while also implementing a complex administrative system through audiencias and later incorporation into the Viceroyalty of Peru. Panama was part of the Spanish Empire for nearly 300 years, from 1538 to 1821.

The colonial experience also spawned Panamanian nationalism as well as a racially complex and highly stratified society, the source of internal conflicts that ran counter to the unifying force of nationalism.

Indigenous pre-colonial history

Uto-Aztecan communities were distributed from the Columbia River through North America, Central America, with some extending into Panama.

A tomb was built between 750 and 800 AD located in the modern-day El Caño Archaeological Park in the Coclé Province of Panama. It was dedicated to a lord who was believed to have been in his thirties. The tomb contained a set of bracelets, two bells, bone flutes, gold circular plates, belts made of gold beads, gold earrings with a sperm whale tooth base, crocodile-shaped earrings, human-shaped earrings, skirts, and canine-teeth bracelets. The tomb also contained what are believed to be human sacrifice victims. High-status people could be buried with eight to 32 people at times.

Dating to approximately 1350-1290 Cal BP, the first evidence of pre-Columbian ridged fields in Panama was discovered near Santa Cruz de Chinina in Eastern Panama. There were 22 blocks of parallel agricultural banks and ditches covering 30 hectares. The complex, located near the Bayano River estuary, incorporated sophisticated water-retention systems and was associated with a settlement site designated as Chinina 1, situated 50 meters north of the raised fields. The settlement site and raised fields demonstrated agricultural practices in rainforest environments. These suggested cultural connection between eastern Panama and the Caribbean plains of Colombia during the pre-Columbian era.

Predominantly, there existed the Guna, the Guaymí and the Chocó peoples. The Guaymí, of the highlands near the Costa Rican border, are believed to be related to Indigenous people of Nahuatlan and Mayan descent originating from Mexico and Central America. The Chocó on the Pacific side of Darién Province appear to be related to the Chibcha of Colombia.

Among all three Indigenous groups— the Guna, Guaymí, and Chocó— land was communally owned and farmed. In addition to hunting and fishing, the Indigenous people raised corn, cotton, cacao, various root crops, vegetables and fruits. They lived in circular thatched huts and slept in hammocks. Villages specialized in producing certain goods, and traders moved among them along the rivers and coastal waters in dugout canoes. Indigenous people were skillful potters, stonecutters, goldsmiths, and silversmiths. Some people wore ornaments, including breastplates and earrings of beaten gold.

The Guna, now settled mainly in Guna Yala along the Caribbean coast of modern-day Panama, have origins that remain debated despite their Caribbean cultural classification. Ethnologists have also indicated the possibility of a linguistic connection between the name Guna and certain Arawak and Carib groups. The possibility of cultural links with the Andean Indigenous people has been postulated, and some scholars have noted linguistic and other affinities with the Chibcha. Migration patterns through Colombia's valleys toward the isthmus may have influenced their settlement.

Historical connections have been proposed between the Guna and both the Cueva and Coiba peoples, though some researchers suggest they may represent a distinct, mostly extinct linguistic group. Guna oral traditions vary, with some claiming Carib ancestry while others cite their divine creation by Olokkuppilele at Mount Tacarcuna near Colombia's Río Atrato.

Chocó peoples have practiced traditional shifting cultivation for thousands of years. Subsistence needs were the primary driver of land use patterns, traditional norms, and settlement history. The eastern Panamanian landscape was previously an old-growth forest or an advanced successional stage.

Archaeologists have found buried, datable Indigenous Panamanian artifacts representing imagery of cats, which depicted socially meaningful strata. However, these studies have faced significant challenges due to widespread archaeological looting. This preservation crisis represents an obstacle to understanding the relationship between felids and pre-Columbian Panamanian societies, but archeological evidence has been found.

Abya Yala is a term from the Guna language that predates the arrival of Columbus and is used to refer to the American continent. It means 'land in full maturity' or 'land of vital blood'.

Initial colonization period When Spanish settlers first encountered Panama in the early 16th century, the isthmus was home to a diverse indigenous population, with estimates ranging from 500,000 across 60 groups to 750,000 Guna people alone. At the time of colonization, the region was primarily inhabited by three major Indigenous groups. This included the Guna, the Guaymí related to Nahuatlan and Mayan peoples, and the Chocó/Embera-Wounaan linked to Colombian Chibcha. These societies practiced communal land, engaged in agriculture, hunting, and fishing, and demonstrated craftsmanship in pottery, stonework, and metallurgy. The common use of gold body ornamentation reinforced the Spanish myth of El Dorado, the city of gold.

The Vizcaina from Columbus's 1501 voyage sunk off the coast of Panama with an estimated $50 million inside. Rodrigo de Bastidas, a wealthy notary public from Seville, was the first of many Spanish explorers to reach the isthmus. Sailing westward from Venezuela in 1501 in search of gold, he explored some 150 kilometers of the coastal area before heading for the West Indies. A year later, Christopher Columbus, on his fourth voyage to the New World, touched several points on the isthmus. One was a horseshoe-shaped harbor that he named Puerto Bello (beautiful port), later renamed Portobelo.

Vasco Núñez de Balboa, a member of Rodrigo de Bastidas' ship crew, settled in Hispaniola, the present-day island of the Dominican Republic and Haiti. However, he stowed away on a voyage to Panama in 1510 to escape his creditors.

In 1510, around 800 Spaniards lived on the isthmus. However, diseases including malaria and yellow fever had killed 740 of them. The settlers at the first city to be duly constituted by the Spanish crown, Antigua del Darién, deposed the crown's representative governing the area and elected Balboa and Martin Zamudio as co-mayors.

Balboa insisted that the settlers plant crops rather than depend solely on supply ships, and Antigua became a monetarily prosperous community. Like other conquistadors, Balboa led raids on Indigenous towns. However, unlike most, he proceeded to befriend certain Indigenous groups. He took the daughter of a chief as his lifelong mistress.

On September 1, 1513, Balboa, accompanied by 190 Spaniards including Francisco Pizarro who later fought the Inca Empire in Peru, a pack of dogs, and 1,000 Indigenous enslaved people, spent twenty-five days hacking their way through the rainforest. The party then gazed on the vast expanse of the Pacific Ocean. Balboa, in full armor, waded into the Pacific and claimed that the sea of its shores was for his God and his King Ferdinand. Balboa returned to Antigua del Darién in January 1514 with 190 soldiers, cotton cloth, pearls, and 40,000 pesos in gold.

Between 1515 and 1517, Spanish expeditions found more than 30,000 pesos worth of gold from the Bay of San Miguel and the Pearl Islands in the Gulf of Panama.

Simultaneously, Balboa's enemies had denounced him in the Spanish court, and King Ferdinand appointed a new governor for the colony. At this time, the colony's name was Castilla de Oro. The new governor was named Pedro Arias de Avila, who became known as Pedrarias the Cruel. He charged Balboa with treason. In 1517, Balboa was arrested, brought to the court of Pedrarias, and executed.

In 1519, Pedrarias moved the colonial capital away from the rainforest climate and the resistant Indigenous people of the Darién. They moved to a fishing village on the Pacific coast, about four kilometers east of the present-day capital. The Indigenous people in the area called the village Panama, meaning "plenty of fish".

In the same year, Nombre de Dios, Colón, a deserted early settlement, was resettled until the end of the 16th century. It served as the Spanish Caribbean port for trans-isthmian transport traffic. A trail known as the El Camino Real, or royal road, linked Panama and Nombre de Dios in Colón. Along this trail, which can still be followed to the modern day, gold from Peru and Spanish galleons were carried by muleback from coast to coast.

The increasing importance of the isthmus for transporting treasure and the delay and difficulties posed by the Camino Real inspired surveys ordered by the Spanish crown in the 1520s and 1530s to ascertain the feasibility of constructing a canal. The idea was finally abandoned in mid-century by King Philip II (1556–98), who concluded that if God had wanted a canal there, He would have built one.

Pedrarias' governorship proved to be disastrous. Hundreds of Spaniards died of disease and starvation in their brocaded silk clothing; thousands of Indigenous people were robbed, enslaved, and massacred. Thousands more of the Indigenous people succumbed to European diseases to which they had no natural immunity. After the atrocities of Pedrarias, most of the Indigenous people fled to remote areas to avoid the Spaniards.

The regulations for colonial administration set forth by the Spanish king's Council of the Indies decreed that the Indigenous people were to be protected and converted to Christianity. The colonies, however, were far from the seat of ultimate responsibility, and few administrators were guided by the humane spirit of those regulations. The Roman Catholic Church, and particularly the Franciscan order, showed some concern for the welfare of the Indigenous people, but on the whole, church efforts were inadequate to the situation.

The Indigenous people, nevertheless, found one effective benefactor among their Spanish oppressors. Bartolomé de las Casas, the first priest ordained in the West Indies, was outraged by the persecution of the Indigenous people. He freed his own enslaved people, returned to Spain, and persuaded the council to adopt stronger measures against enslaving the Indigenous people. He made one suggestion that he later regretted—that Africans, whom the Spaniards considered less than human, be imported to replace the Indigenous people as enslaved labor.