Brazilian federal police agents patrol the Mamore River, which separates Brazil from Bolivia and is used by traffickers to ferry cocaine from Bolivia into their country. (Juan Forero/THE WASHINGTON POST)

The cocaine that anti-drug officials say is flooding into Brazil these days comes from neighboring Bolivia, in small planes that make 20-minute flights, in luggage ferried into river ports and in small dugout canoes that make clandestine trips in the middle of the night.

But in hamlets such as this one, Brazilian federal police officers try to stem the flow by urging villagers to report the suspicious activity on the 2,126-mile frontier with Bolivia, one longer than the U.S.-Mexico border. And in a speedboat, others patrol the Mamore River separating the two countries, guessing which of the countless motorized boats are carrying drugs bound for Brazil’s big cities.

“Here, the problem is grave, with lots of drugs crossing constantly,” said Alexandre Barbosa, one of 35 federal police officers assigned to this sector in Rondonia state in far western Brazil. “You see this region, where the frontier is separated by a river. So there are many ports. Every 100 meters, or sometimes less, you see a port. So you can move from one port to the other very fast.”

The tide is not favoring Brazil, which is facing the newest big trend in the transnational drug trade in South America.

Law enforcement and health officials say demand for cocaine and its highly addictive derivative, crack, is on the rise in Brazil just as traffickers are seeking new markets to take up the slack left by falling consumption in the United States. The challenge Brazilian policymakers face is like no other for a big consuming country: Brazil shares half of its 10,000-mile-long border with the world’s three biggest cocaine producers, Bolivia, Colombia and Peru.

With somewhere between 1 million and 2 million cocaine users, Brazil has for years been the world’s No. 2 market, drug experts say. And the country offers cocaine traffickers an increasingly alluring market because of the huge growth potential spurred by a fast-expanding middle class.

“Brazil is being flooded,” said Bo Mathiasen, a senior United Nations counterdrug official who studies trafficking across the continent. “If you’re trafficking cocaine, and you know there’s a big and growing market, that’s where you want to go.”

A country that once saw large-scale drug trafficking as an American problem with little impact here is now squarely focused on carrying out a strategy that relies heavily on reinforcing the porous frontiers it shares with 10 countries.

Since announcing a strategic border plan in 2011, President Dilma Rousseff has deployed thousands of soldiers to the border, many of them with special police powers. The government also has moved to increase the number of law enforcement officers, which until recently numbered only one for every 10 miles of frontier, according to a federal auditor’s report. A fleet of aerial drones will be used to help monitor the most remote regions of jungle bordering Bolivia and other countries.

“We see this as a problem of security and, at times, a problem of national defense,” said Regina Miki, national secretary of public security at the Ministry of Justice. “It’s a problem of sovereignty.”

Drug fight seen as investment

Officials say the tactics are costing billions of dollars. But Brazil considers the money an important investment as the country works on its image in preparation for soccer’s 2014 World Cup and the 2016 Summer Olympics.

The United States is sharing intelligence to help Brazil’s interdiction efforts, said a State Department official who works on drug issues and who spoke on the condition of anonymity because of the sensitive nature of the cooperation between the two countries.

Cocaine crosses Brazil’s porous border

“The Brazilians know they have a problem,” the official said. “They saw what happened to us in the United States when crack took over, and they’ve been at the forefront of trying to get ahead of the curve.”

Gil Kerlikowske, director of the White House Office of National Drug Control Policy, said the cooperation goes beyond interdiction to drug treatment, a pillar of Brazil’s plan for weakening drug trafficking. Yet, in many ways, Brazil’s methods have had some of the same results as the hard-line, war-against-drugs approach taken by the United States.

Brazil’s prison population has more than doubled since 2000, and drug seizures, a yardstick favored by American policymakers to measure success, have increased sixfold in the same time period.

The new Brazilian strategy comes as significant changes have begun to take hold in the countries that have traditionally led cocaine production and consumption.

In Colombia, long the top producer of cocaine and the No. 1 supplier to the American and European markets, the amount of land dedicated to growing coca, the leaf used to manufacture the drug, has fallen by more than half since 2001. And the U.S. government said Colombia’s potential to produce cocaine has tumbled from 700 metric tons a dozen years ago to less than 200 metric tons in 2011.

Colombian and American officials credit a multibillion-dollar program of aerial fumigation, largely funded by Washington, as well as assistance and training that have helped security forces beat back drug-trafficking rebels and traditional cocaine cartels.

In addition, the U.N.’s 2012 World Drug Report says that cocaine use in the United States has fallen by two-thirds since 1982, with a particularly notable decline since 2006.

But coca production has increased dramatically in recent years in Peru and Bolivia, as traffickers adjusted and homegrown cocaine smuggling outfits popped up. Kerlikowske’s anti-drug office at the White House estimates a sharp uptick in production in both countries.

“Clearly, Peru and Bolivia have kind of eclipsed the problem of Colombia,” Kerlikowske said.

‘Business is always growing’

Bolivian and Peruvian cocaine is smuggled to Europe and south to one of the biggest markets on the continent, Argentina, where per-capita consumption of cocaine has rivaled that of the United States and European countries, according to U.S., European and Brazilian officials.

But the big prize for drug traffickers has been Brazil, with nearly 200 million people. And the majority of cocaine consumed here is Bolivian, according to Brazilian police data.

That, too, is a sharp break from the past, when Bolivian cocaine made it to the streets of Washington and New York.

“Bolivia is really no longer a threat, in comparison to the 1980s, to the U.S.,” said Eduardo Gamarra, a Bolivian-born professor of Latin American affairs at Miami’s Florida International University. “The cocaine market for Bolivia is in Brazil. It’s in Sao Paulo. It’s in Belo Horizonte. It’s in the cities, and it’s growing.”

Sabino Mendoza, an adviser on coca issues to Bolivian President Evo Morales’s government, said in an interview in La Paz that Bolivia does not consider itself a trafficking country. He said the problem is Peruvian cocaine that winds its way through Bolivia en route to Brazil.

“For us and for Brazil, obviously it’s a concern,” he said. “And between the two countries we are resolving it.”

Here on the border in Brazil’s Rondonia state, federal police agents give little thought to the origin of the cocaine. What they do know, they say, is that both Bolivian and Brazilian traffickers are involved.

As he steers a patrol boat with three other federal police agents on the Mamore, officer Jonas Marques says traffickers work to get the drugs to the gritty Bolivian border town of Guayaramerin. “It’s a city where drug trafficking dominates,” he said.

The drugs are stockpiled there and in other communities and later flown into Brazil aboard small aircraft or brought across by river.

Traffickers pay $50 for each kilogram, or 2.2 pounds, of cocaine. The drugs are later shipped to the state capital, Porto Velho, for about $250 a kilogram and finally sold for up to $6,000 a kilo in Sao Paulo or other big Brazilian cities.

“People buy much more cocaine than they did two, three or five years back,” Marques said. “So business is always growing. It’s quite profitable.”