One Friday night last month, the men came in from the coca fields and ended this town's days as a drowsy, forgotten farming center.

The narcotics police from La Paz had parked their blue Dodge pickup down where Indian women slouched with loads of green bananas. The agents, hungry and loud, came reeling from liquor after a raid out in the hills.

Then from out of the night, dozens of peasants -- wearing scarlet hoods and carrying planks, machetes and dynamite -- massed in the plaza and on the roads leading out of town.

Minutes later, the matron of the movie hall recalled, people thumping on her door yelled: "Dona Rosa, Dona Rosa, they are killing the narcotraficos."

By next morning, seven members of Bolivia's narcotics control force were sprawled dead on the street, their bodies mutilated and burned. And this steep valley had joined the wide stretches of mountainside, jungle lowland and river plain across the central continent that have melted away from their legal governments and into the South American sovereignty of cocaine.

Around the ridges and valleys of this center 70 miles northeast of La Paz, thousands of acres are blooming with the small, light-green coca plants that have flourished here for centuries. Four times a year, the leaves are plucked, dried, stamped, doused with kerosene and sulfuric acid, and turned over to men who take them by boat and plane to faraway labs in Colombia or the northern Bolivian jungle.

The result is the fine, white powder of cocaine, smuggled into the United States by the thousands of pounds and purchased with billions of dollars every year. For U.S. consumers, it is an expensive, dangerous treat provided through an extensive and subterranean trading system--and provoking a costly series of government law-enforcement programs.

It is here, and in expanding swatches of remote Peru, Bolivia and Colombia, that U.S. middle-class indulgence has created a whole new society. It is a strange and violent world with its own population, laws, heroes, armed forces, and increasingly, almost sovereign territory.

Fields farmed by an estimated 125,000 small farmers in the zone supply almost all of the cocaine produced in the world. Some of the territory is old, impoverished and long since conquered by the trade. But other great patches are newly colonized jungle, settled and developed by man for the first time for the sole purpose of supplying U.S. drug users.

This population in eastern Bolivia, southeastern Peru, and the northern Amazonian basin of Peru and Colombia is governed by sprawling underground bureaucracies and populist, patronal kingpins who pave roads, establish wage scales, build airports and factories and raise armies for common defense.

The region's economy is one of the world's greatest and perhaps the most warped, worth at least $4 billion a year in incoming earnings and easily ahead of several of the continent's established nations.

In this society, it is not unusual to find banks in towns that are little more than a jungle clearing. Millions of dollars in transactions might take place there daily. Palm-leaf huts in the fields are furnished with Panasonic stereos and flanked by Volvos or Toyotas.

In much of the region, the central governments no longer even contest for control. After the murders in Chulumani last month, authorities in La Paz simply announced they had no immediate plans to send their agents back into the town, or the wide Yungas region around it.

That is not unusual. In the southeastern Chapare region around the town of Villa Tunari, Bolivian authorities pulled out earlier this year after their forces were beaten by local residents. Both Bolivian and Peruvian police stay out of the wild border zones around Lake Titicaca, where government agents were expelled by force four years ago.

Parts of the eastern Peruvian jungle are similarly sealed off, and in Colombia, where some coca communities are in league with local guerrilla groups, authorities enter several zones only by calling in the Army and mounting a military invasion.

In all these areas, officials repeat a phrase that has come to be less and less facetious: "We go in if we are invited."

South American governments have come to have a curiously mixed relation with this cocaine kingdom. Officially, they blame it for corruption, violence and distortion in their economies and divert substantial resources and manpower to trying to interrupt the trade.

Unofficially, they have sometimes found themselves benefited and even supported by cocaine. Wild regions of their territories have been colonized and put to work by the industry. Impoverished farmers have migrated and found stable incomes.

In Bolivia, the foreign exchange market until recently was dependent on cocadollars, and in Peru, dollars are pumped into the central bank by traffickers buying government bonds.

Over the years, the people most interested in cracking down on the cocaine regions have often been officials of the United States, which has pumped millions of dollars into police forces and prodded governments into creating special narcotics boards, laws, and crop-elimination programs.

Now, in Bolivia and Peru, the Reagan administration hopes to invest nearly $100 million in similar five-year programs to uproot coca fields in selected regions and persuade farmers, with credits, training, aid and stiff enforcement threats, to grow something else.

Officials agree, though, that even this large-scale effort will only begin to bring the cocaine country under control, and might not even make more than a dent in the overall cocaine traffic to the United States.

"We do not expect success overnight," said Edwin Coor, ambassador to Bolivia and a specialist in drug enforcement who helped design the U.S. programs in both Peru and Bolivia. "This is a social problem that will probably never be solved. Our goal is to make it manageable."

More than 300,000 acres of coca are estimated to be growing in Bolivia, Peru and Colombia. Farm families follow a trade that to many of them has been natural and honorable for hundreds of years.

Although use of cocaine or coca paste is almost nonexistent in Bolivia and relatively limited in Peru and Colombia, Indians in these countries have been growing and chewing the relatively harmless coca leaves since before the time of the Incas. Both Peru and Bolivia had legal coca growers and markets long before the United States created a modern market for cocaine.

The base of this new business might be explained by one small plot on a steep hillside outside of Tingo Maria, Peru, the center of the upper Huallaga Valley growing region that produces an estimated 16,000 tons of coca leaf annually.

There, Rumando Rubinos, an Indian farmer, has been growing coca most of his life. He and his wife and four children share a low, concrete shelter and a hut of wood poles and palm leaves perched on the level top of a hill.

For a pound of dried coca leaves, he is paid about $4 by illegal traffickers, compared to the 56 cents paid on the old legal coca market. A pound of yucca, which he also grows for food and fiber, sells at the town market for about four cents.

Coca plants, after 18 months of nurturing, produce four full harvests year after year.

"With coca, you live, without it, you don't," Rubinos said as he looked over his one-acre field of bushes. "The people here have always lived by coca. There is no other way."

It is this kind of simple economics, more than the multi-million dollar fortunes reaped by traffickers in Colombia or Miami, that explains the awesome boom of cocaine in the Andes. In Bolivia, officials now estimate that a 2.5-acre crop of coca can be worth around $5,000, compared to $500 for the same amount of coffee. In Colombia, workers who go to the eastern plains to pick coca leaves are paid nearly $20 a day, compared to the $5 elsewhere.

The result has been like a gold rush. Officials say the population of Tingo Maria, a threadbare settlement with one paved road some 330 miles northeast of Lima, has quadrupled in the last five years to 55,000. A Colombian senator estimated that 40 percent of the 350,000 people living in his district on the once-desolate southeastern plains had moved in for the coca business.

The tens of thousands of hungry new farmers, pickers and colonists are the backbone of the coca country. They have marked out its territory, respected and followed its leaders, and formed a mass of hostile opposition to the undermanned authorities who have sought to impede the trafficking of their crops.

"It's very difficult to make these people understand that the coca, which has been growing in some areas for centuries and now for the first time can earn them a decent living, is something they should give up all of a sudden," said Humberto Pelaez, a Colombian senator from a rural growing area in the southern mountains around Popayan. "It is only natural that they would resist the end of what feeds them."

Most of the coca farmers know little of the network of collectors, financiers, lab workers, plane pilots, couriers and kingpins above them in the cocaine society and that has filled small towns like Tingo Maria with half a dozen car dealers and poker games to shame Las Vegas high rollers.

Most of the largest organizations for cocaine trafficking are based in Colombia, and between 75 to 90 percent of the cocaine product from Bolivia and Peru is believed to pass through Colombian hands and routes.

These major enterprises -- officials believe there are at least 100 multinational organizations in Colombia -- buy coca in semi-processed form from smaller syndicates in Peru and Bolivia and arrange its transport by plane or riverboat to southern Colombian spots like Leticia, a booming underground financial capital.

In Peru's upper Huallaga Valley for example, the sacks of dried coca leaves are often picked up from local farmers by a collector, who might take them to his own, larger farm and process them with acid and kerosene into an alkaloid-rich paste.

Collectors deliver their goods to larger operators, who usually work for a local financier with Colombian connections. When a shipment is ready, Colombians arrive in the valley carrying dollars. They change the money to Peruvian soles at a local bank, pay the Peruvian financier, then ship the cocaine up Amazon tributaries to Leticia, or fly it in DC-3s from roughed-out airstrips.

In this way, said drug authorities in Tingo Maria, the Bank of Credit in Tocache, Peru, saw $25 million come in during 40 days this fall as Colombians carrying dollars changed them into soles under Peruvian exchange laws.

In Colombia, semi-processed loads of cocaine are taken to one of hundreds of laboratories near the urban centers of Medellin, Bogota or Cali for the final conversion into cocaine powder. It is then ready for shipping -- by private plane or smuggling on commercial air routes--to the United States.

At each step along the away, the prices and profits soar, marking the economic strata of a whole society of bureaucrats and entrepreneurs. From the $4 paid for a pound of leaves in Tingo Maria, a pound of pasty alklaloid sells for $405. Transported by river to Iquitos, Peru's Amazon port, it sells for $1,350. In Leticia, the price is $1,600. In Medellin, Colombia, a pound of finished cocaine now could retail for $6,000. In Miami, it would be $15,000 higher and on the street in New York it could be worth $250,000.

Huge fortunes are made, and along with them, legendary bosses. Around Peru, it used to be Guillermo Cardenas Davila of Bella Vista, known as the "Mosca Loca," or Crazy Fly. In Colombia, there is "the queen of coca," Griselda Blanco, who allegedly ripped off associates in Medellin on a cocaine shipment and tried to fool vengeful hitmen by mailing a coffin back to Colombia from Miami that was said to contain her body.

The most well known of the bosses now may be Roberto Suarez of Bolivia, who has been indicted by a U.S. grand jury in Miami for cocaine trafficking. U.S. envoys have demanded his extradition by successive Bolivian governments.

And yet Suarez, like many of the big cocaine traffickers, is not a criminal but a hero to most of the people who live in his territory of northern Bolivia.

"It will be very difficult for the us to trap Roberto Suarez in Bolivia, because practically all of the people support him and help him." said Alberto Canales, an official of Bolivia's Narcotics Control Board. "Here, there is a conviction that the authorities are bad, that people come to government to steal.

"Against that, Suarez, who does not take a government salary, who does not get credits from the central bank, who paves streets in small towns and helps people with their medical bills, is a good guy. He's a Robin Hood."

Suarez certainly exploits his dashing image. Once this year, he reportedly mailed a letter to President Reagan offering to pay Bolivia's foreign debt in exchange for the release of his son, who is being held in Miami on drug charges. Another time, when Bolivian authorities offered $10,000 for information leading to his arrest, Suarez reportedly offered $20,000 for information on anyone who informed on him.

Such tactics of Suarez--and others of his rank in the cocaine country--help explain why small farmers would descend on Chulumani in the middle of the night to murder the local narcotics force.