In short
On December 31, 1999, after nearly a century of rule, the United States officially ceded ownership of the Panama Canal to the nation of Panama. That nation did not exist when, in the mid-19th century, Europeans first began to explore the possibilities of creating a link between the Atlantic and Pacific oceans through the narrow but mountainous isthmus; Panama was then a remote and overlooked part of Colombia.
All that changed, writes David McCullough in his magisterial history of the Canal, in 1848, when prospectors struck gold in California. A wave of fortune seekers descended on Panama from Europe and the eastern United States, seeking quick passage on California-bound ships in the Pacific, and the Panama Railroad, built to serve that traffic, was soon the highest-priced stock listed on the New York Exchange.
To build a 51-mile-long ship canal to replace that railroad seemed an easy matter to some investors. But, as McCullough notes, the construction project came to involve the efforts of thousands of workers from many nations over four decades; eventually those workers, laboring in oppressive heat in a vast malarial swamp, removed enough soil and rock to build a pyramid a mile high. In the early years, they toiled under the direction of French entrepreneur Ferdinand de Lesseps, who went bankrupt while pursuing his dream of extending France's empire in the Americas.
The United States then entered the picture, with President Theodore Roosevelt orchestrating the purchase of the canal—but not before helping foment a revolution that removed Panama from Colombian rule and placed it squarely in the American camp.