BISSAU, Guinea-Bissau — The headquarters of the Judicial Police, the government agency charged with prosecuting Guinea-Bissau’s war on drugs, sits on a dusty street in the middle of this deceptively quiet West African capital city. Inside is the country’s only drug-testing laboratory, a recent addition thanks to a surge in European Union funding to curb the flow of illegal narcotics north toward its borders.

Without guards or metal detectors, the lab hardly feels like the front line in a war against violent criminals thought to be trafficking billions of dollars worth of cocaine each year. But officials say the assorted vials and testing equipment here represent an important, if limited, first step toward routing the South American cartels that have ventured thousands of miles from their home turf to stake out an ideal drug transit point in one of Africa’s weakest states.

“We want to diminish 80 to 90 percent of the drug trade flowing into Guinea-Bissau,” said Sargento Natcha, the lab’s soft-spoken coordinator, as he tested a small sample of cocaine with a kit bought with donor funds. “The EU has promised to send more equipment.”

But the odds are stacked against Natcha and his team at the lab. Key players in the country’s notoriously corrupt government — the same government that must act on any leads produced by the lab — are thought to be backing the drug trade. The United Nations has dubbed Guinea-Bissau, an impoverished nation of 1.7 million, Africa’s first “narco-state.” For decades, its governing elite is known to have opened the country to South American drug barons who use it as a base for smuggling vast quantities of cocaine to Europe, according to the United Nations. According to the United Nations, 60 percent of the cocaine consumed in Western Europe makes its way through West Africa.

The routes are varied, with some drugs transported through the Sahara — passing through Mali, Mauritania, Algeria, and Morocco and then on to Southern Europe — and other shipments crossing the Atlantic bound for the United States. Guinea-Bissau is a key hub in both cases. According to a 2012 U.N. report, an estimated 50 Colombian drug lords were based in Guinea-Bissau, operating alongside members of Mexico’s powerful Sinaloa cartel. The report estimated that they were flying 2,200 pounds of cocaine into the West African nation every night.

Smugglers have gained a foothold in the tiny West African nation in part because of its persistent political instability, experts say. Since independence in 1974, the military has participated in nine coups or attempted coups and no elected political leader has ever served a full term in office. Current President José Mário Vaz fired two prime ministers in 2015, deepening a political crisis that has strengthened the resolve of the military brass to protect cocaine trafficking as their key source of income.

“During military dictatorships [that lasted until 1994] the military was used to getting benefits [from drug trafficking],” said Miguel Trovoada, head of the U.N. Integrated Peacebuilding Office in Guinea-Bissau, adding that desire to control the drug trade has fostered political instability since then. “In all the coups, the military didn’t take over governance responsibilities, leaving that to others.”

Much of the country’s ruling class is now thought to be implicated in the trade, forming what Mark Shaw, a professor of criminology at the University of Cape Town in South Africa, calls an “elite protection network” for the cartels. Senior military figures in particular provide security and logistics to South American drug cartels in exchange for money and drugs, according to Shaw.

Examples of corrupt military officials abound: In 2013, the former army chief of staff, Gen. Antonio Indjai, was indicted by a federal grand jury in New York for trying to import cocaine into the United States, though he denies the allegations and remains a free man in Guinea-Bissau. Likewise, former navy chief José Américo Bubo Na Tchuto was captured in a U.S. Drug Enforcement Administration sting in 2013 and a year later pleaded guilty to importing narcotics, including cocaine, into the United States.

The international community has gradually woken up to the problem. The United States, European Union, and United Nations, in particular, have invested billions of dollars in recent years in battling the drug trade and supporting development. In addition to Natcha’s lab, aid dollars have helped set up a transnational crime unit that supports the government’s anti-corruption department, according to Mário José Maia Moreira, the representative of the U.N. Office on Drugs and Crime (UNODC) in Guinea-Bissau. Moreira said his office is also working to obtain boats that can be used to conduct seizures, since the country’s counternarcotics units currently lack operational vessels.

But progress has been slow. Moreira estimates that dozens of tons of cocaine still move through Guinea-Bissau every year, a figure that he reckons is less than in the past but still worth more than “the entire annual military budget of many West African countries.” This year, only 11 kilograms of cocaine have been seized so far — or a tiny fraction of the estimated total that flows through the country en route to European countries every year.

“If you were a drug smuggler from South America, wouldn’t you choose Guinea-Bissau, considering the system and the fragility of the country itself?” said Moreira. “The authorities are still very fragile in terms of resources.”

A recent report by the respected Jane’s Intelligence Review confirms Moreira’s assessment. In addition to accusing the military for being “complicit” in the drug trade, the report concludes that Guinea-Bissau “remains an important hub for cocaine trafficking to Europe, despite the anti-trafficking initiatives of the United Nations and other international organisations.”

Outside the capital city, drug smugglers operate virtually unmolested by authorities. In the fishing village of Kassumba, a known smuggling hub near the border with Guinea, law enforcement has no visible presence at all. White sandy beaches and palm trees give the impression of calm, but the reality is very different: According to the UNODC’s Moreira, smugglers drop sealed packages containing small quantities of cocaine into the coastal waters here. The packages are retrieved by local fishermen and passed on to military officials and politicians, who oversee their safe transport to Bissau.

Those members of the security services that are not a part of the official smuggling racket remain woefully under-equipped. On Bubaque Island in the Bijagós island chain, an archipelago of mostly uninhabited land known as a center for smugglers, five hours by slow boat from Bissau, a soldier named Djibril Sanha explained how he’d been tasked with combating drug trafficking and illegal fishing, but had been given virtually no resources.

“We have no boats, no communication devices, and only our mobile phone,” he said in an interview. “I don’t understand what I’m doing here. You give us a head and stomach but no legs.”

Despite billions of dollars spent over the last decade by international donors, the weakness of West African states like Guinea-Bissau continues to attract opportunistic traffickers. Much of the aid has simply been swallowed up by corrupt officials who are in on the game; some of what was promised was never disbursed because of fears that this might happen. Meanwhile, collaboration between drug traffickers and the government has only deepened, according to U.N. officials.

Back in the drug-testing lab in Bissau, the scale of the challenge before officials like Natcha was clearly on display. The coordinator furnished a list of names of traffickers who had been caught at the airport in 2015 with cocaine in their stomachs: None was carrying more than 2.5 kilograms (about 5.5 pounds). But more importantly, none had any known affiliation with the government.

Photo credit: TONY KARUMBA/AFP/Getty Images

Correction, Jan. 6, 2016: Europe is trying to stop Guinea-Bissau’s drug trade. An earlier version of this article misspelled the country’s name in the subheading as Guinea-Bisseau.