The lush national parks of Costa Rica, with their rainforests, white beaches and thermal springs, have long attracted tourists from around the globe. Recently, they have lured more unsavoury visitors in the form of drug traffickers.

Organised crime cartels have turned to Costa Rica's treasured nature reserves as governments wage military offensives against the gangs throughout Mexico and Central America. In the mangrove swamps and jungles, the traffickers have found a vast, sparsely populated and thinly policed paradise that they can use as a haven on their way to smuggle Colombian cocaine to the United States. They also increasingly grow marijuana amid the cedar and lemonwood trees.

Costa Rica prides itself on not having a standing army, but the incursion has put lightly armed park rangers into the front line of the drugs war as they struggle to prevent hikers and swimmers bumping into any rude surprises. In January, the Coast Guard was called in for an unprecedented seizure of almost a ton of cocaine – worth $100m (£64m) on US streets – found in swampy mud in the Palo Seco park. In total, Costa Rican authorities seized more than 6.6 tons of cocaine in the first half of this year, in and out of parks, compared with less than three tons in the same period last year. In all of 2011, 8.9 tons of cocaine were seized.

Park rangers have also uncovered dozens of gangster encampments, complete with food supplies. "Drug traffickers come in, make pathways for their trucks and set up their camps, waiting for drug shipments to come in by boat," said Carlos Martinez, head of police in Quepos, a town near Costa Rica's most popular park, Manuel Antonio, 80 miles from the capital of San José.

Drug cartel expansion into Costa Rican parks is seen as part of a "balloon" effect of the narcotics trade, which has been targeted by military offensives in Mexico, Colombia, Honduras and Guatemala. Costa Rica's anti-drug tsar, Mauricio Boraschi, said: "You squeeze the balloon in the south, then you squeeze it at the top and what you get is pressure in the centre, so... the cartels' operations are extending to Central America." Police say the smuggling is carried out mainly by Mexican cartels.

Traffickers bring large amounts of cocaine out of Colombia's Pacific port of Buenaventura from where they can sail straight into parks such as Manuel Antonio, which has large stretches of Pacific beach, Boraschi said. They can then continue north on the Pan-American Highway, or organise further trips up the coast.

Costa Rica abolished its army in 1948, so is unable to pursue a Mexican or Colombian-style military crackdown. However, the government has strengthened co-operation with the US navy in hitting traffickers in the South Pacific. It also recently levied a tax on businesses to raise $70m for anti-drug efforts, including special police units.

The cartels have not attacked park rangers but there is increasing concern about the safety of travelling to distant corners of the reserves. "[Rangers'] duties used to be mainly conservation, environmental education and looking after park visitors," said Rafael Gutierrez, at the National Conservation Areas System. "Now their job has changed."

Costa Rica's 28 parks cover a quarter of the national territory, so there are almost endless marshes, mountains and jungles where traffickers can hide. To pull out the ton of cocaine in Palo Seco in January, officers spent an entire day fighting through mangrove swamp water up to their necks.