Ecuador narcos
Some 70 percent of cocaine that arrives in Europe comes from Ecuador, according to a coast guard official. AFP

At Guayaquil, Ecuador's biggest port and export hub, drug gangs and the coast guard play a cat-and-mouse game, vying for supremacy of the river among the many hidden inlets and tangles of mangrove.

The Guayas Estuary, with its 28 ports, is the heart of the violence-torn country's economy.

Excluding oil, 80 percent of Ecuador's exports pass through here, including key products such as bananas and shrimp.

It is also the main export channel for drugs.

"Seventy percent of the cocaine that arrives in Europe comes from Ecuador, and 80 percent of this cocaine comes out of Guayaquil," navy coast guard commander Fernando Alvarez, whose unit is at the forefront of the fight against trafficking, told AFP.

According to Alvarez, Ecuador has become the main cocaine distributor in the world, with most of the drugs originating in neighbors Colombia and Peru -- the world's top producers of cocaine.

Daily, Alvarez and his team patrol the Guayas River.

To the right of them is a forest of mangroves shielding shrimp farms. To the left, miserable poverty-stricken neighborhoods in which gangs rule with an iron fist.

And in the middle of the water lane, a massive container ship about six storeys high -- the perfect vessel for a hidden drug stash.

The coast guards' job is a complicated one.

On the one hand, they have to look out for speed boats, semi-submersibles and even submarines now employed by ever-wealthier drug traffickers along the nearly 75-kilometer (46-mile) channel that connects Guayaquil to the open sea.

"The whole city is connected via canals. It is a very, very complicated task to control all this," one officer told AFP on condition of anonymity for fear of being targeted.

Another threat is criminals who bring drugs from ashore in canoes or small boats, use ropes or ladders to clamber up the sides of tankers and container ships bound for the United States or Europe, and hide the contraband there.

"These criminals are real spidermen," said the anonymous officer.

"There are mangroves everywhere, it's very easy to hide," he added.

The intruders, some of whom pose as fishermen, usually act under the cover of darkness, sometimes with the complicity of the crew, according to the coast guard.

"If there is a risk of 'contamination,' we board with a tactical group to protect the ship," said Alvarez.

Shipping companies increasingly also rely on protection from private security escorts.

According to Alvarez, the gangs often follow the vessels carrying their illicit goods, and "do not hesitate to open fire" if they spot anyone on their tail.

"They are ever more violent. They adapt constantly" -- also trying to buy off members of the security forces.

The gangs are in cahoots with three major transnational traffickers: Mexico's Sinaloa and Jalisco New Generation cartels, and Albanian groups with ties to Italy's notorious 'Ndrangheta mafia.

Alvarez said about 80 percent of crimes intercepted by his unit nowadays are related to drugs.

The same patrols are also tasked with securing the waterway to the protected Galapagos archipelago from illegal Chinese and Spanish fishing fleets.

And while the task is sometimes overwhelming, the state of emergency declared last week to put down a violent gang uprising "has changed things in our favor," said Alvarez.

"It has changed the rules on the use of force, and since these gangs are now considered fighting forces, this allows us to respond more robustly."

Once a bastion of peace, Ecuador has recently been plunged into crisis after years of expansion by transnational cartels.

The latest violence was triggered by the escape from Guayaquil prison just over a week ago of one of the country's most powerful narcotics gang bosses.

The government declared a state of emergency and countrywide curfew, infuriating gangsters who declared war against civilians and security forces, launching several deadly attacks and taking dozens of hostages. Most have since been freed.

By Sunday, Ecuador's security forces said they had taken control of several prisons back from gangs and reported more than 1,300 arrests, 27 escaped inmates recaptured and eight gangsters, whom the government describes as "terrorists," killed.