Time hasn’t been friendly to Kipling and his views. The imperialist grabfest, so gaudy at the time, has left little of lasting value–little besides the Panama Canal. Ships glide between jungled hills on a 50-mile water bridge. The lock doors, 10 stories high, weigh hundreds of tons, yet are so finely balanced that in a tunnel between each set of locks is a wheel eight feet in diameter with which, should the power fail, a single man can work the doors by hand. Grand in scale and beautifully imagined, the canal can stand with the Pyramids and the Great Wall.

To build it, though, we encouraged Panama to separate from Colombia. Without a Panamanian’s being consulted, we drafted a treaty giving the United States sovereign rights over the heart of Panama’s national territory. And with Colombia ready to repossess its wayward province, we exacted Panamanian ratification.

Not pretty. Besides offending every Panamanian, the treaty offended many Americans, yet U.S. governments ignored Panama’s repeated requests to renegotiate it until, in 1964, blood was shed over it. After that, although we had closer ties to Panama than to any other nation, divorce was the best option for securing our long-term national interest: a stable country and an open canal.

The transfer, then, culminates the imperialist era. The predatory exuberance of Teddy Roosevelt’s “I took the isthmus!”–acceptable, if just barely, in 1903–gives way to fairness and moral leadership. It completes an act of national self-assertion with one of unprecedented generosity.

The withdrawal has been handled with exemplary grace. During the 20 years it has been going on, Panamanians have replaced Americans without a hitch. Meanwhile, every year the Canal Commission has spent $100 million on maintenance and $40 million to $50 million on outright improvements–new tugboats, new locks locomotives, new high-mast lighting for night transits. Panama will get the waterway in tip-top condition and has already taken delivery of more than a dozen U.S. military installations with airports, docking facilities and hundreds of buildings. I have heard the figure $4 billion, but whatever the exact value, it is more than any nation has ever received from another without having conquered it in war.

Still, Panama’s future is uncertain. When I went to Panama 42 years ago as a soldier, the country spent a higher percentage of its product on public education than any other in the hemisphere, the United States included. Good public schools meant social mobility. A person could make it from poverty into the country’s growing middle class. Social mobility and the narrowest gap between rich and poor in Latin America meant calm and order. The police carried no firearms.

Now one sees obscene fortunes and racking want. Panama has the largest gap between rich and poor in Latin America, the third largest worldwide. The cause of this growing inequity, and of the political class’s pervasive corruption, was a loathsome dictatorship that the United States believed or pretended to be benign and progressive. Panama’s dictators removed the priority given to public education. And while they were ready to murder their enemies, they preferred to corrupt. The rich and connected turned a blind eye to the violence the regime inflicted on ordinary Panamanians. Panama’s new president, Mireya Moscoso, wants to help the poor, but Panama’s political class, which will dispose of the U.S. bounty, is largely unable to do so in a manner that will benefit the country.

The other part of the problem is Panama’s neighbor. Colombia’s civil war is spilling into Darien province. Colombian guerrillas use Darien as a place to rest and refit. Paramilitary units pursue them. These penetrations have increased as the strength of the U.S. garrison diminished. A growing portion of the province is out of Panama’s control, yet few if any Panamanians think the solution is to remilitarize the police.

Panama is an interesting square on the world chessboard. For a century it has been controlled by a world power. It is not likely to remain entirely free from similar control very long. The Japanese, the Chinese and the Taiwanese are jostling for influence, making toothsome offers–among them a second high-level bridge across the canal to complement one the United States built in 1963. The government is holding security talks with the United States, but has ruled out U.S. bases. Many on both sides would like to preserve something of the special relationship between Panama and the United States. Can a way be found, or will it end with the century?