Deep in the swathe of rainforest that hugs the Panama canal, our guide, Pedro, stopped alongside a tree with a strangely swollen trunk. "This is the pot-bellied tree. If you get lost in here without water, take your knife, slice into the bark, and just put your lips against it.

"But," he paused, "it will also inflate your abdomen and stop you peeing. So only do it if you're severely dehydrated."

My brain filed Pedro's pot-bellied tree in the survival compartment. But I had already honed an equally unexpected technique: you can buy Volvic with Visa and even get good drinking water straight from the Panamanian taps. While much of the land remains forested, the city and central zone is surprisingly developed.

Classic preconceptions about the country - that it is essentially a canal and that it produces hats - are only half right. Panama hats are made in Ecuador. But the word canal can scarcely convey the magnitude of a feature that is at once an awe-inspiring feat of engineering, a sanctuary for countless species of birds and animals, and a trading route that shaped continents.

Trade and shipping have brought people to Panama from all over the world, though tourists are comparatively rare, despite the fact that the canal area is a fine place for visitors to explore: encompassing rainforest, the urban south, lakes and Caribbean beach resorts within the space of 100km.

Arriving at night in Panama City with the jungle in mind, it was something of a surprise to awaken to a Pacific coastline of gleaming skyscrapers, the offices of banks from around the world competing with the apartments of millionaires taking advantage of Panama's slippery tax benefits.

The hot and humid capital is unspectacular, but busy and often fascinating. Relatively compact (a taxi will take you anywhere for a couple of dollars), you pass rich dwellings with well-tended lawns and utterly desperate, dark, concrete housing blocks in a short drive.

The most picturesque area is across town in San Felipe: crumbling colonial architecture, and flowers cascading from the balconies of brightly painted houses. Nevertheless, although this quarter is on the up after being declared a Unesco world heritage site in 1997, in parts the poverty remains only too evident.

Carnival brought thousands out onto the streets in the evening, but by day it meant the churches and museums were closed. So we didn't get to see San José's Golden Altar; and we didn't make it past the entrances of other tempting buildings, watched by surly guards who would no doubt have preferred to be sleeping off last night's seco with the rest of their compatriots. But it's an atmospheric quarter for a stroll - even though taking a side street from the central Plaza Catedral resulted in a stern warning from a mountain-biking tourist policeman. You mustn't, it seems, contemplate San Felipe after dark.

Still, it's vital not to miss San Felipe, for it's home to the Herons' Palace (the official presidential residence) and the headland at the Plaza de Francia. Here, above a monument dedicated to the doomed French canal venture, there are great views of both the city skyline and, to the other side, the Bridge of the Americas, the only land link from the north to the south of the continent.

Panama's history is one of conquest and plunder, and you don't have to go far to see the evidence. A few miles south-east is Panama Viejo, the remains of the original Spanish settlement, destroyed by the British privateer Henry Morgan in 1691. You need a guide to bring the thick stone walls to life, to trace the houses of Spanish aristocrats and the remaining flank of the burned Catholic church.

The most obvious foreign influence is that of the US. Driving out from the city, you quickly enter the Canal Zone, previously US territory in the very heart of Panama: the canal wasn't handed over until December 1999. Suddenly, there are defined lawns, fences, little league baseball parks - a bizarre slice of sterile, malaria-free Americana keeping the jungle at bay.

The canal begins at Miraflores locks. We looked on as a huge cruise ship, the Viking Serenade, glided through the gates into a space that looked barely wide enough to hold it. Teams of men and several small but impressively solid tug trains kicked into action. It's slow rather than spectacular, but conceptually it's amazing: the giant liner elevated by 80ft to progress from the Pacific to the Caribbean, a feat made possible by the shifting of a whole landscape through decades of work.

Prior to this 20th century marvel, the only way across the continent was either via Cape Horn or trudging overland. We got a taste of the latter during a six-hour trek along the trail of Las Cruces, the path used by early European invaders to transport gold and supplies across the continent. Our unlikely attempt at an early morning departure meant we were in the rainforest too late in the day for any sane creature to be active and, apart from the lesser-spotted sweaty Brit, there were few signs of wildlife. But there was no shortage of interest: we stumbled over various potential cures for cancer, watched cutter ants in action and sucked trustingly on various roots proffered by Pedro.

Despite the gallons of DEET on our skin, the bugs were closing in. Apart from one of our party getting a beetle in her eye, the thrills were limited to dodging the black palms and saw grass. Then, in the treetops, we saw a crowd of red coatis. Or at least, some of us did: as the news filtered back down the trail ("I think it's a monkey!"), the happy shrieks of a nature-lover sent the coatis bolting.

Fortunately, strange beasts turned out to be more easily spotted from the comfort of the boats that we boarded at our next destination, Gamboa, at the mid-point of the isthmus where the River Chagres flows into the canal. Pretty much the only accommodation there is a plush resort, complete with cocktails, buffets and buggies to ferry you around. This was adventure travel at its least taxing, but no one was complaining down by the pool; at least not until we added severe sunburn to our mosquito-scarred limbs.

Beyond the pampering, Gamboa offers the option of staying in buildings formerly owned by the American canal administration. In contrast to the rest of the resort, these felt hugely atmospheric; pastel-coloured clapperboard houses with huge ceiling fans, a taste of the US deep south but with the noises of the jungle all around.

Gamboa is really one for the twitchers: the hardcore who rose for an early morning walk on Pipeline Road (think Trafalgar Square but really exotic pigeons) seemed well satisfied. Later, we took a cable ride through the rainforest canopy to a hilltop panorama; endured a trip round the rather underwhelming reptile and butterfly houses; and, best of all, took a night cruise on the river.

Under a night sky filled with insects and satellites, we followed the beam of our boatman's torch as it picked out the burning red eyes of birds and beasts. We chugged upriver to find a small caiman floating on the surface, before it dived away; then found ourselves feet from a magnificent kingfisher, stock still on a branch. Trees full of herons gave way to circling, restless pelicans. We rounded off the trip staring down at a bank of capybaras, the kind of ugly rodent you might produce if you crossed a rat with a hippo.

Ultimately, though, you can't beat the canal. The next morning, as huge cargo ships waited outside the enormous locks in a stately queue; and others charged with containers ploughed their way from Pacific to Caribbean, we took speedboats and rushed through the waters, nipping between islands. We'd slow to watch a sloth or hawk disguised in the treetops, or pull over to see spider monkeys brandishing sticks from branches overhanging the banks. Panama is an unexpected feast: like the pioneers of old, you just need to dig in.

Way to go: Gwyn Topham travelled as a guest of Explore Worldwide, on their first Panama tour. For reservations, contact Explore on 01252 760 000. A nine-day trip costs from £899 plus $210 local payment, including return flights from London via Madrid with Iberia. A four-day extension to the San Blas islands is also available.