The earliest known inhabitants of Panama were the Cuevas and the Coclé cultures, but they were decimated by disease and the sword when the Spanish arrived in the 16th century. After several forays along the country's Caribbean shore, the Spanish settlement of Nombre de Dios was established at the mouth of the Río Chagres on the Caribbean coast in 1510. Panama's Pacific coast later became the springboard for invasions of Peru, and the wealth generated by these incursions was carried overland from the Pacific port of Panama (City) to Nombre de Dios. The transport of wealth attracted pirates, and by the 18th century, the Caribbean was so dangerous that Spanish ships began bypassing Panama and sailing directly from Peru around Cape Horn to reach Europe.
Panama went into decline, and became a province of Colombia when the South American nation received its independence in 1821. In 1846, Colombia signed a treaty permitting the USA to construct a railway across the isthmus and to defend it with military force. The idea of a canal across the isthmus had been broached even in the 16th century, but a French attempt to build one in 1880 resulted in the death of 22,000 workers from malaria and yellow fever and bankruptcy for everyone involved. A Frenchman who stood to gain handsomely from a US buyout of the French rights to build a canal was named 'envoy extraordinary' by Washington, and he negotiated and signed a canal treaty with the USA, despite the objections of the Colombian government. The financial and strategic interests of the US momentarily coincided with the sentiments of Panama's revolutionaries, and a revolutionary junta declared Panama independent on November 3, 1903, with the overt support of the USA.
The canal treaty granted the USA rights in perpetuity over land on both sides of the canal and a broad right of intervention in Panamanian affairs. The treaty led to friction between the two countries for decades, partly because it was clearly favorable to the USA at the expense of Panama and partly because Colombia refused to acknowledge Panama's independence until 1921 when the USA finally paid Colombia US$25 million in compensation. The USA began to build the canal again in 1904, and 10 years later, the first ship negotiated the engineering marvel. The US intervened in Panama's affairs repeatedly up until 1936, when it relinquished its right to use troops outside the Canal Zone. The two countries continued to argue over the canal contract until a new treaty was signed in 1977. Panama formally regained control of the canal in 1999 at a ceremony attended by Mexico's president, Spain's king and former president Jimmy Carter, but not by any senior American officials.
General Manuel Noriega took control of the country in 1984. A former head of Panama's secret police and a CIA operative, Noriega became a demagogic bogeyman. Murdering political opponents, quashing democracy, drug trafficking and money laundering were his principal concerns during the 1980s, activities which eventually attracted US sanctions and freezing of Panamanian assets. When the winning candidate of the 1989 presidential election was beaten to a pulp on national TV and the election declared null and void, Noriega's regime became an international embarrassment. Noriega appointed himself head of government on December 15, 1989 and announced that Panama was at war with the USA. The following day an unarmed US soldier dressed in civilian clothes was killed by Panamanian soldiers - or so the Pentagon claimed. The Panamanian version of events was that the soldier was not only armed but that he had shot and injured three civilians before running a roadblock.
Since US forces had for months been itching for a pretext to attack, this was more than enough reason to call in 26,000 troops for 'Operation Just Cause.' The invasion, the intention of which was to bring Noriega to justice and create a democracy better suited to US interests, left more than 2000 civilians dead and thousands more homeless. Noriega escaped capture by US troops for six days by claiming asylum in the Vatican embassy. US forces surrounded the embassy and pressured the Vatican to release him. They memorably used that psychological tactic beloved of disgruntled teenagers and bombarded the embassy with blaring, devilish, rock music to psychologically wear down those inside. It worked (as any parent knows); Noriega was sent to the US, where he was convicted on money laundering charges; he is currently serving a 40-year prison sentence in Florida.
The legitimate winner of the 1989 presidential election, Guillermo Endara, was sworn in as president. But Endara proved to be an ineffective president whose policies cut jobs and cost his administration the popularity it initially enjoyed; by the time he was voted out of office in 1994, Endara was suffering from single-digit approval ratings. In the 1994 elections - the fairest in recent Panamanian history - Ernesto Pérez Balladares came into office. Under his direction, the Panamanian government implemented a program of privatization and focused on infrastructure improvements, health care and education. Pérez Balladares was barred from running for a second term, and in September 1999 Mireya Moscoso, the widow of popular former president Arnulfo Arias, Panama's first female leader and head of the conservative Arnulfista Party (PA), took office.
'The canal is ours!' shouted President Moscoso, and at last it was. Thirty-six years after student demonstrations in Panama caused a break in diplomatic relations between the two countries, and more than 22 years after the USA vowed to return the Canal to Panama, it was handed over in a sunny ceremony on January 1, 2000. In the days and weeks following the handover, ships passed through the canal without a glitch, no foreign nation made an attempt to capture it and the Panamanians celebrated.