In 1513 the Spanish conquistador Vasco Núñez de Balboa first crossed the Isthmus of Panama. When the narrow nature of the Isthmus became generally known, European powers noticed the possibility to dig a water passage between the Atlantic and Pacific Oceans.

A number of proposals for a ship canal across Central America were made between the sixteenth and nineteenth centuries. The chief rival to Panama was a canal through Nicaragua.

By the late nineteenth century, technological advances and commercial pressure allowed construction to begin in earnest. French entrepreneur Ferdinand de Lesseps led the initial attempt (1880–1889) to build a sea-level canal, as he had previously achieved in the building of the Suez Canal (1859–1869). A concession to build the canal was obtained from the Colombian government, at that time the possessor of the Panama Isthmus. The canal was only partly completed, as a result of the severe underestimation of the difficulties in excavating the rugged terrain, heavy personnel losses to tropical diseases, and increasing difficulties in raising finances. The collapse of the French canal company (1889) was followed by a political scandal surrounding alleged corruption in the French government. In 1894, a second French company (the Compagnie Nouvelle du Canal de Panama) was formed to take over the assets of the original French company, with the intention of finding a prospective buyer.

Interest in a U.S.-led canal effort developed in the late 1890s, and was considered a priority by President Theodore Roosevelt (1901–1909). Roosevelt gained Congressional support to buy the French canal concession and equipment, despite a longstanding preference amongst political leaders and the public for the Nicaragua route. After encountering resistance from the Colombian government to what they considered unfair terms, Roosevelt gave his support to a group of Panamanians seeking to secede from Colombia. He then signed a treaty with the new Panamanian government enabling the project. The critical decisions by which the U.S. took over construction of the canal were heavily influenced by the lobbyists William Nelson Cromwell and Philippe Bunau-Varilla, acting on behalf of the Compagnie Nouvelle du Canal de Panama. The terms of the treaty between the U.S. and Panama heavily favored American interests, and remained a source of tension between Panama and the United States until the signing of the Torrijos–Carter Treaties in 1977.

The Americans' success in constructing the canal hinged on two factors. First was converting the original French sea-level plan to a more realistic lock-controlled canal. The second was controlling the diseases which had decimated workers and management alike under the original French attempt. The Americans' chief engineer John Frank Stevens (the second Chief Engineer of the American-led project) built much of the infrastructure necessary for later construction. Following his resignation, the new chief engineer was George Washington Goethals, whose tenure saw the completion and opening of the canal. Goethals divided the workload into three divisions: Atlantic, Central, and Pacific. The Central division, overseen by Major David du Bose Gaillard, was responsible for the most daunting task, the excavation of the Culebra Cut through the roughest terrain on the route. Almost as important as the engineering advances were the healthcare advances made during the construction, led by William C. Gorgas, an expert in controlling tropical diseases such as yellow fever and malaria. Gorgas was one of the first to recognize the role of mosquitoes in the spread of these diseases and, by focusing on controlling the mosquitoes, greatly improved worker conditions.

On 7 January 1914, the French crane boat Alexandre La Valley became the first to traverse the entire length of the canal, and on 1 April 1914 the construction was officially completed with the hand-over of the project from the construction company to the Panama Canal Zone government. The outbreak of World War I caused the cancellation of any official "grand opening" celebration, but the canal officially opened to commercial traffic on 15 August 1914 with the transit of the SS Ancon.

During World War II, the canal proved vital to American military strategy, allowing ships to transfer easily between the Atlantic and Pacific. Politically, the canal remained a territory of the United States until 1977, when the Torrijos–Carter Treaties began the process of transferring territorial control of the Panama Canal Zone to Panama, a process which was finally completed on 31 December 1999.

The Panama Canal continues to be a viable commercial venture and a vital link in world shipping, and is periodically upgraded. A Panama Canal expansion project started construction in 2007 and began commercial operation on 26 June 2016. The new locks allow the transit of larger Post-Panamax and New Panamax ships, which have greater cargo capacity than the original locks could accommodate.

Early proposals in Panama

16th-18th centuries The first to conceive the idea of the Panama Canal was the Spanish conquistador Vasco Núñez de Balboa, who first crossed the Isthmus of Panama in 1513. He wrote in his journal the possibility of a canal but did not take action. Instead, the first trans-isthmian route was established to carry the plunder of Peru to Spain from Panama to Nombre de Dios.

In 1534, seeking to gain a military advantage over the Portuguese, the Spanish ruler Charles V, Holy Roman Emperor ordered a survey for a route through the Americas in order to ease the voyage for ships traveling between Spain and Peru.; Chapter 3, Some Early Canal Plans

In 1668, the English physician and philosopher Sir Thomas Browne speculated in his encyclopedic work, Pseudodoxia Epidemica, that "some Isthmus have been eaten through by the Sea, and others cut by the spade: And if the policy would permit, that of Panama in America were most worthy the attempt: it being but few miles over, and would open a shorter cut unto the East Indies and China".

Given the strategic location of Panama, and the potential of its narrow isthmus separating two great oceans, other trade links in the area were attempted over the years. One early example of this was the ill-fated Darien scheme, launched by the Kingdom of Scotland in 1698 to set up an overland trade route. Generally inhospitable conditions thwarted the effort, and it was abandoned in April 1700. In 1788, Americans suggested that the Spanish should build the canal, since they controlled the colonies where it would be built. They said that this would be a less treacherous route for ships than going around the southern tip of South America, and that tropical ocean currents would naturally widen the canal after construction. During an expedition from 1788 to 1793, Alessandro Malaspina outlined plans for construction of a canal.

19th century

The idea of a canal across Central America was revived during the early 19th century. In 1811, the German naturalist Alexander von Humboldt published an essay on the geography of the Spanish colonies in Central America (Essai politique sur le royaume de la Nouvelle Espagne; translated into English as: Political essay on the kingdom of New Spain containing researches relative to the geography of Mexico). In the essay, Humboldt considered five potential routes for a canal across Central America: (1) across the Isthmus of Tehuantepec in Mexico; (2) across Nicaragua, traversing Lake Nicaragua; (3) across Panama from Limón Bay to Panama City (the route later built); (4) across the Darién Gap along the Atrato and Napipi Rivers, then continuing down to Cupica Bay on the Pacific side; and (5) also in the Atrato region, along the "Lost Canal of the Raspadura", a legendary canal built by local inhabitants. Of the five routes, Humboldt considered the Nicaragua route the most promising and the Panama route the least promising options, partly because he estimated the mountains at Panama to be three times their actual elevation. Because of his prestige as a scientist, Humboldt's assessment became definitive for many through the nineteenth century.

In 1819, the Spanish government authorized the construction of a canal and the creation of a company to build it.Numerous canals were built in other countries in the late 18th and early 19th centuries. The success of the Erie Canal through central New York in the United States in the 1820s and the collapse of the Spanish Empire in Latin America resulted in growing American interest in building an inter-oceanic canal. Beginning in 1826, US officials began negotiations with Gran Colombia (present-day Colombia, Venezuela, Ecuador, and Panama), hoping to gain a concession to build a canal. Protective of their newly gained independence and fearing domination by the more powerful United States, president Simón Bolívar and New Granada officials declined American offers.

The United Kingdom attempted to develop a canal in 1843. According to the New-York Daily Tribune, 24 August 1843, Barings Bank of London and the Republic of New Granada entered into a contract for the construction of a canal across the Isthmus of Darien. They referred to it as the Atlantic and Pacific Canal, and it was a wholly British endeavor. These plans for the canal led in 1848 to the capture of San Juan de Nicaragua, at the Caribbean Sea end of the projected canal, by a British gunboat. A diplomatic crisis between the British and the United States was averted by the Clayton–Bulwer Treaty, in which the two nations bound each other to joint control of any canal built in Nicaragua or (by implication) anywhere in Central America.

In 1846, the Mallarino–Bidlack Treaty, negotiated between the U.S. and New Granada, granted the United States transit rights and the right to intervene militarily in the isthmus. In 1848, the discovery of gold in California generated renewed interest in a canal crossing between the Atlantic and Pacific Oceans. William Henry Aspinwall, who had won the federal subsidy to build and operate the Pacific mail steamships at around the same time, benefited from the gold discovery. Aspinwall's route included steamship legs from New York City to Panama, and from Panama to California, with an overland portage through Panama. This route with an overland leg in Panama was soon frequently traveled, as it provided one of the fastest connections between San Francisco, California, and the U.S.' East Coast, about 40 days' transit in total. Nearly all the gold shipped out of California went by the fast Panama route. Several new and larger paddle steamers were soon plying this new route, including private steamship lines owned by American entrepreneur Cornelius Vanderbilt that made use of an overland route through Nicaragua, and the unfortunate SS Central America.

In 1850, Aspinwall founded the Panama Railroad Company, together with explorer John Lloyd Stephens and banker Henry Chauncey. The Company sought to build a railroad across the Isthmus of Panama from Limón Bay on the Caribbean Sea to Panama City on the Pacific Ocean. The initial estimate was that the railroad would take two years to build; it eventually opened in 1855, and cost US$8 million, six times the originally-estimated cost. The railroad also produced a high number of fatalities, as workers succumbed to diseases such as cholera, smallpox, dysentery and malaria. The cost in human life is unknown, but is estimated between six and twelve thousand. The overland link nonetheless became a vital piece of Western Hemisphere infrastructure, greatly facilitating trade. The later canal route was constructed parallel to it, as it had helped clear dense forests.