A decade ago, it was a relatively small law enforcement problem. An undercover narcotics officer describes how much worse the streets have gotten.

Reporting from Quito, Ecuador — To hear a 20-year veteran of the force tell it, the streets of Ecuador are a lot meaner for undercover cops these days.

The anti-drug officer says narcotics are flooding in, a fellow detective was killed during a recent sting operation, and months of painstaking investigative work are routinely squandered by corrupt or threatened judges who let suspects go.

"Many of my colleagues are extremely discouraged and worried. But we're fighting on. We're doing it for our children," said the longtime officer, who asked that his name not be published for security reasons.

Violence in Ecuador is rising across the country, with crimes of all kinds up 15% to 50% last year compared with 2009 depending on the province, according to government figures. Although murders have declined in neighboring Colombia, they are on the rise here, doubling over the past 20 years to nearly 19 per 100,000 residents in 2009, the last year for which figures are available.

Fueling much of the violence is drug trafficking, which a decade ago was a relatively small law enforcement problem. Now, an estimated 200 tons of cocaine, or one-quarter of all that's manufactured yearly in Colombia and Peru, transits through Ecuador.

The undercover cop is no Serpico look-alike. Neatly groomed and dressed in a tasteful dark suit, he looks like the typical middle-class father of three that he is. But concern seemed to weigh on him, and as he spoke he warily checked passers-by.

He said the anti-drug police force is overwhelmed with the criminal activity that increased drug trafficking has brought.

Mexican, Russian, Chinese and Korean drug mafia members regularly visit to arrange deals, he said. Ever-increasing numbers of "mules" are caught at Quito's international airport smuggling cocaine or cash. Growing amounts of cocaine paste are brought here to be processed because of the Colombian government's crackdown on illicit labs.

Despite some spectacular interdictions in Ecuador, including the capture last July of a 70-foot submarine that authorities say was capable of transporting up to seven tons of cocaine, seizures of cocaine and heroin dropped to 15 tons last year from 44 in 2009.

Foreign officials believe a number of factors — none of them positive — are responsible for the decline, including the closure in 2009 of the Manta aerial surveillance station in northwestern Ecuador that was used to interdict fishing boats and submarines thought to be shuttling cocaine north. President Rafael Correa declined to renew the base's lease, saying the presence of U.S. aircraft infringed on Ecuadorean sovereignty.

A wave of drug-fueled violence recently hit home. Police Lt. Darwin Arango, a good friend of the officer, was shot to death in his car in March by suspected narcos as he conducted a surveillance operation on the outskirts of Quito. Arango's partner, who was wounded in the shooting, was hustled out of the country for his own safety.

"We have two suspects in custody," the officer said. "We believe narcos paid them $50,000 for the killing."

But what has especially galled the officer and other cops is that drug suspects they arrest end up evading justice because, they charge, corrupt or frightened judges are letting them go.

"Many suspects who are given conditional freedom then go and threaten witnesses, who then disappear," said the undercover policeman, charging that in May alone, eight suspects were released under suspicious circumstances despite what he describes as solid cases against them.

In the judges' defense, some observers say many are temporary appointments, and are in a sort of limbo until Correa's judicial reform package is implemented, which could give him more appointive powers. Others say judges generally are poorly trained in narcotics and money-laundering cases and are easily swayed by defense attorneys who challenge evidence.

That was the rationale in late May for one judge's release of four men who had been held in coastal Manabi province in connection with the seizure of three tons of cocaine found camouflaged on the beach in 2010. The judge said evidence linking the suspects to the cocaine was weak. But counternarcotics agents who helped gather intelligence that led to the arrests say the case was strong.

"You have to ask yourself, why should the state dedicate so many resources to months of investigation when the cases fall apart at the judicial level?" the cop said.

He said the police ranks were especially peeved when a judge recently ordered that $36 million in assets be handed over to the wife of Antoine St. Surin, a Haitian who was extradited to the United States in late 2009. St. Surin is being held in a Miami jail pending his trial on federal drug-trafficking charges.

"We spent three years building a case," the cop said. "These things happen and no one complains or says anything. They're too afraid."

Western counternarcotics officials routinely praise the bravery and initiative of Ecuadorean law enforcement, many of whom have gone through special training abroad. Arango, the undercover agent killed in March, was one such agent.

"This is a great country with many outstanding people," the policeman said. "But the narcos are winning."