It was three days after arriving in Costa Rica and the holiday was not shaping up as my most relaxing ever.

Leaning heavily on a bicycle, I formed part of a panting, dirt-spattered conga line of cyclists pushing their machines up a near-vertical hill. All around me was breathtakingly beautiful rainforest but, struggling hard not to slip over, I kept my eyes fixed grimly on the ankle-deep mud around my feet.

"To think I gave up my vacation time for this," the wheezing rider ahead of me muttered. "What the hell was I doing?"

Welcome to adventure holidaying, Costa Rican style.

The compact Central American nation, sandwiched between Nicaragua and Panama, is already well known as a magnet for backpackers and nature lovers.

As well as being wealthier and more politically stable than its neighbours - the military was constitutionally abolished in 1949 - Costa Rica packs an amazing variety of natural beauty into an area little bigger than Switzerland, around one-quarter of which is national parkland.

The country's tourist trade is heavily geared towards outdoors pursuits, whether jungle trekking and bird watching or more vigourous activities such as surfing and white-water rafting.

But every year, one intrepid group - this time including me - goes a step further. They get to see the entire breadth of the country from the saddle of a bicycle.

La Ruta de los Conquistadores (The Route of the Conquerors) has, over the past 14 years, grown from an informal ride organised by an intrepid group of friends into one of Costa Rica's most famous events.

Retracing the path taken by an army led by the Spanish conqueror Juan de Caballuten in the mid-16th century, riders wind 170 miles from the Pacific coast to the Caribbean Sea, through rainforests, coffee plantations and even over an extinct volcano.

Much of the difficulty comes from the weather: coming near the end of the rainy season, heavy downpours often turn sections of the course into a mudbath.

But while it is marketed as the toughest such race in the world, La Ruta's appeal comes from the fact that - in theory - any keen amateur with sufficient training and commitment can complete it.

I remained to be convinced.

A good percentage of my own preparation consisted of simply cycling to and from work as fast as I could, and meeting my fellow participants for the first time - ranks of tanned, muscle-bound superhumans - I was prepared for the worst.

Instead, apart from a small minority of professional riders swanning around in their team T-shirts and sponsored baseball caps, the bulk of the 400 or so racers were ordinary mortals. Around a tenth were women and many entrants were in their 30s, 40s or even 50s.

On the eve of the race, in the Pacific resort town of Jaco Beach, I was billeted in a hotel room with Dave, a cheery, whippet-lean Texan. He confessed his own worries.

Day one began at the eye-watering hour of 5.15am, allowing riders the full 12 hours of daylight to complete what was acknowledged as the toughest stage, 60 miles long and containing more than 13,000 feet of uphill riding.

"Get through this and you'll find the rest of the race easy," grinned a kindly official, passing me a drink after I limped, sweating, into the first water station two hours later.

The problem was, I couldn't get through it.

The road rapidly changed to dirt track and then mud, a bright-red clay-based gloop with the consistency of drying cement. As the hills became steeper there was nothing to do but get off and push, step by agonising step, under a searing tropical sun.

One section between water stations was just under seven miles long. It took me three hours. "This is like a death march," a nearby rider panted.

The end, when it came, was swift.

Descending a short hill I realised I was shivering uncontrollably and feeling dizzy. Dejected, I sat down on a pile of rocks next to a similarly stricken Canadian cyclist and we waited for the support truck to pick us up.

Strange as it sounds, we were lucky. Others pressed on to the end but were so exhausted they had to sit out day two. My roommate Dave, I discovered later, spent the next day in hospital attached to a rehydrating drip.

At that night's hotel in the Costa Rican capital, San José, I found out that more than one-quarter of the entire field had, like me, failed to complete the course.

"We thought day one last year was a bit too easy so we added a new section," a race official confided. "I think we overdid it."

If this sounds more like a boot camp for masochists than a holiday, then rest assured that better - much better - was to follow.

The next day brought blissfully cooler temperatures as we climbed towards the peak of Irazú, a 10,000ft high extinct volcano in the centre of the country. The jungle melted away, replaced by steeply rolling grasslands, like a particularly lush, hilly Somerset.

Passed the volcano, the route plunged through a rocky valley, with the braver riders - I wasn't among them - bouncing along downhill at 30 miles or more an hour.

The final day was more dramatic still. After descending further towards the Caribbean coast, the route followed an old railway line lined by lush jungle, interspersed by rusty iron bridges over idyllic rivers.

Finally, the path veered parallel to the beach, winding for 10 miles through beautiful mangrove forests, the surf crashing just yards away.

The finish point, near the town of Puerto Limon, was actually on the white sand beach. Like everyone else, I completed the race in the La Ruta traditional way - dropping my bike to sprint fully clothed into the ocean.

As I emerged dripping from the water, a camera crew approached, filming footage for a US cable TV channel. "So how was La Ruta?" grinned the producer?

"It was great," I replied, ecstatic. "So you're back next year?" he asked. "Not a chance," came my instant, unthinking response. "Do you think I'm crazy?"

His smile faded.

Did I mean it? At the time, yes. But even an hour later, showered and chatting over a cold beer with fellow racers, I could already feel an immense glow of satisfaction at what I had achieved, as the pain ebbed away.

Two days afterwards, sitting on the beach in Puerto Viejo, a laid-back strip of wooden hotels, restaurants and bars 60 miles down the coast, the aches, blisters and hours in the shower scrubbing mud from my body were fast-forgotten memories.

"Have you heard the news?" one fellow rider staying in the same hotel asked me. "Day one was so tough this time the organisers are splitting it in two next time."

I could be tempted.

• La Ruta de los Conquistadores - now expanded to four days - takes place from November 14 to 17 in 2007. Riders can register for the race at the official website, which is in English as well as Spanish.

Entries cost from $999 (£516), which includes hotel accommodation before and during the event, meals and full support during the race, including food, water and medical care.