In the Ecuadoran city of Durán, riddled with drugs and rival gangs, Police Captain Jean Carlos Bustamante knows exactly what he is up against – not just the criminals who kill and sometimes dismember their rivals, but also the enemy within. This was reported by Qazaqyia.kz citing BBC News.

"We have many, many bad people inside our unit, inside the state, inside politics," he says. "We have many, many guys that are corrupt. They are in the pay of the gangs." The only police officers he can trust, he says, are the ones right beside him - members of his hand-picked team. At 34, Captain Bustamante is the oldest among them and moves like the special forces officer he used to be.

With the sun setting, he leads his team into a hardscrabble neighbourhood where windows are sealed off behind metal grills, and lips are sealed by fear. This is the heart of gangland, controlled by a group called Los Aguilas (Spanish for The Eagles). I ask what happens if local people speak out against the gangs. "They kill them," the captain replies. "So that's why they never say nothing."

He's heading for an abandoned house where he believes weapons have been hidden. He and his team line up, hugging the wall, heavily armed, and tightly packed. A battering ram gets them through the door. They find two handguns – one rusty but the other ready to be fired - and ammunition for an assault rifle. The captain says he's happy with the result. "The first reason is because we are safe," he says. "The second is that there are two guns less for the gangs." But this is a small victory, in a war of attrition. He admits the gangs have "many weapons and much more money than the state".

He knows the risks only too well – having lost three close friends fighting the gangs. He has also lost his fear he says, "years ago", but his parents have not. "My Mum says 'be careful, maybe you can die there'," he tells me. "My Dad calls all the time and asks 'my son, are you good? Tell me that you are good.'"

A line can be traced - in dollars and in broken lives - from the back streets of Durán to the hotspots of London, and other capital cities. Around 70% of the cocaine reaching Europe and the US is funnelled out of Ecuador, according to the country's president, Daniel Noboa. The drug pours in from neighbouring Colombia and Peru – the two biggest producers in the world. Powerful home-grown gangs – with links to Mexican cartels and Albanian mafia groups – help smuggle the cocaine onwards. They take advantage of Ecuador's weak border controls, underfunded security forces, and long Pacific coast.

In the process what was a peaceful tourist haven in South America has – in under a decade - become a killing ground. Last year the murder rate was one of the highest in the world, with more than 9,200 people killed, according to Ecuador's interior ministry. That's despite an iron-fisted crackdown by President Noboa over the past two years. Critics say it has backfired. Top crime bosses have been arrested, causing the gangs to fracture, but also to multiply. Many here believe the war against the gangs will never be won.

When we join him for another operation he's lying in wait getting a bird's eye view of the back alleys from a drone. He sees three figures moving around at the edge of a playground – "micro-traffickers" - caught in the act, he says. They are at the bottom of the drug chain, selling locally, in minute amounts, not kilos. Within minutes he and his team have tracked the suspects to their door. The battering ram is out again, and soon they are in the kitchen, where a middle-aged woman protests, and a young girl bursts into tears. The police move from room to room, by torchlight - there's no power - opening wardrobes and lifting mattresses. Upstairs, they find a hiding place behind a window. A young suspect emerges and is detained. Two others are handcuffed in another room. All three are led away, denying that there were dealing drugs.

Nearby the captain finds tiny paper packets of "H" stashed in a flowerpot. It's a highly addictive mix containing small amounts of heroin sold by neighbourhood dealers for $1.00 (£0.75) per packet. One of the suspects is charged, and if convicted, he could get five years in jail. Prosecutors release the other two. Senior officers say that happens a lot. They blame corruption in the justice system, and the prosecutor's office.

"We imprison them [gang members] and they release them," says Colonel Santiago Gavilanes, deputy commander of Durán police. "We know because when we carry out raids, we recapture them. Some of those who are released kill people and leave orphans behind." He tells us that the gangs have money to "buy laws, judges, and politicians".

We get an example of the buying power of the gangs from another police officer, in a different location. For his safety, we cannot reveal his name or where he is based. He told us he was contacted twice by text and offered a massive bribe - "enough money to retire on". He turned it down. Someone – a colleague perhaps – had informed the gang exactly where he worked and what he did. "You never know who is watching," he said. We heard that a lot during a week in Durán, and surrounding areas.