LONDON -- Christine Endrigkeit illustrates the shabby state of the terrorist underground today in Europe. When she was arrested last month by West German police for alleged involvement in the 1986 bombing of a Berlin discotheque, she was living with her boyfriend in a squalid, unfurnished apartment in a working class area of Lubeck. She was sleeping on the floor and her clothes were hanging from pegs hammered into the wall. It was a far cry from the glamorous lifestyle favored by terrorists a decade ago, and a reminder of how much European terrorism has changed.

The arrest of Endrigkeit was the latest in a long string of intelligence and police successes against terrorists operating in Europe. After twenty years of almost constant battle that has cost dozens of lives and caused hundreds of millions of dollars in damage, there are signs that, at last, home-grown terrorism in Europe may be under control and even, in many cases, on the brink of defeat.

The State Department's statistics indicate that terrorists in Europe may indeed be on the run. International terrorist attacks in Europe have declined from 218 in 1985 to 137 last year. Meanwhile, aggressive law enforcement has decimated some of Europe's most successful terrorist groups. Those in France and Belgium have nearly been wiped out, while groups operating in West Germany, Italy and Spain have been badly mauled.

Things looked very different in June 1984. At a secret meeting in Lisbon that month, representatives of all the established European terrorist movements (except the IRA) met to discuss forming a new alliance. From that meeting emerged what became known as the anti-NATO terrorist alliance, which joined members of French, Belgian, Italian and West German terrorist groups in a common fight.

A communique issued in January 1985 announced the formation of a "political-military front in western Europe" with NATO as its main target. "Attacks against the multinational structures of NATO, against its bases and its strategies, against its plans and propaganda, constitute the first large mobilization," said the communique. Predictably, many of those targets were American, and the degree of cooperation quickly became evident. Explosives stolen in Brussels were used in bombs by Action Directe in France, the Cellules Communistes Combattantes in Belgium and the Red Army Faction in West Germany. There also seemed to be agreement about targets. The Red Army chose three American companies. The first targets chosen by the Belgian CCC were the same.

The police and intelligence services were taken almost totally by surprise by these developments. They had achieved considerable success against many of the older terrorists who had first emerged in the late 1960s and had rolled up several groups, such as the Baader-Meinhof. But by the early 1980s, there were no informants in place, police tactics hadn't been changed in years and there was little co-operation among governments. Intelligence about terrorists operating in one country was rarely shared with another, national police forces jealously guarded their own turf and were resentful of outside interference or advice and, above all, political leaders seemed unable to agree on a common strategy.

Belgium, for example, had chosen to ignore the terrorist problem altogether. Several terrorists on the run, including some of the leaders of Action Directe were living in the country and were well-known to the police. But the Belgian government took the view that, as long as no terrorist acts were committed on Belgian soil, then terrorists could come and go as they wished. It swiftly changed its view when the CCC began bombing on Belgian soil.

The terrorists, by contrast, had learned from their mistakes. They were better organized, operating in small secure cells that were difficult to penetrate and their recruits came from various sectors of society, not just the university-educated middle class as before. What changed Europe's perception of the problem was the U.S. raid on Libya on April 14, 1986. Immediately after the raid, President Reagan went on national television to proclaim: "Today we have done what we had to do. If necessary, we shall do it again." The immediate European reaction was consternation. While Britain had allowed American F111s to fly from bases in the U.K., other European countries had been less enthusiastic and France had refused to allow the U.S. aircraft to overfly French territory. What united the Europeans was the word "again" in Reagan's statement. The idea that the United States might carry out another such raid filled all the countries with horror. Rather than face that reality, they chose instead to develop a common policy to fight terrorism, which the United States had been asking for more than two years.

Both Europe and America looked to West Germany for the way ahead. In 1972, in the midst of the highly successful terrorist campaign by the Baader-Meinhof group, the West German Bundeskriminalamt (federal police) established a revolutionary new computer system called Inpol. It was designed to store a mass of information on ordinary criminals and suspected terrorists including personal habits, operating characteristics and any other details that might help develop a predictable operating pattern or identify a suspect. There are now 4,000 terminals linked to Inpol spread around Germany and three million names on file. The computers proved to be the key to breaking the Baader-Meinhof movement and they were to be central to destroying the next generation of terrorists as well.

In the immediate aftermath of the Libyan raid, there was a flurry of meetings between the different police and intelligence agencies in the United States and Europe. To the surprise of many of those involved in the discussions, there was already available a great deal of information about terrorists that had simply never been shared. For example, information on the terrorist activities of Libyan diplomats in Europe was circulated and, as a result, diplomats were expelled from France, Italy, West Germany and even Greece. Similar information-sharing allowed security services to preempt at least a dozen major terrorist incidents within two months of the Libyan raid.

Technical barriers to cooperation also began to fall. New computer programs were developed that will allow different national computer systems to talk to each other. The goal is that a counter-terrorist expert in Washington will someday be able to use his computer to draw freely from the data bases of computers in Britain or France for information on international terrorists.

The U.S. intelligence community is already busy installing a new computer system that will allow for the automatic analysis of thousands of files on terrorists, their operations, known contacts and resources. The aim is a system that identifies patterns that can help predict where terrorists will strike next. Similar systems are also being installed in European countries.

The information that is fed into the computer data banks comes in large part from electronic intelligence gathered by various eavesdropping devices that range from satellites to the simple phone bug. So sophisticated has signals intelligence become that analysts at the U.S. National Security Agency can target specific telephone numbers or calls from whole cities to be picked up by satellites or other collection devices. Computers, too, can automatically sift through the millions of words to pick up conversations that use key words. Unfortunately, few terrorists talk openly, so the analysts spend their time sifting through conversations to distinguish terrorists' coded talk of "delivering oranges" (grenades) from a couple discussing their grocery shopping.

Much more cooperation is needed. Today, consular offices and embassies of different nations in different countries cannot share common information. So if a suspected terrorist applies to the U.S. embassy in Warsaw for a visa to visit the United States and is turned down, he could easily go next door to the French embassy and be granted a visa. A new system is being designed that will give embassies and consular officials around the world access to similar information.

The European intention is to build a wall around the outer perimeter of European countries but make it easier to move about inside this cordon sanitaire. Tighter perimeter checks have been introduced and a more efficient cross-checking centralized data system has also proved effective. For example, the arrest in West Germany last year of Mohammed Ali Hamadei, the man suspected of playing a key role in the 1985 hijacking of a TWA aircraft during which a U.S. Navy diver was murdered, was largely due to the wide circulation of intelligence gathered by the United States.

The intelligence community, too, has been reorganized to make terrorism a priority target. In the United States, both the Central Intelligence Agency and the Defense Intelligence Agency have set up new covert units in an attempt to gather more information and help formulate more effective policies. And in Britain, the Security Service (once known as MI5) has made terrorism its top priority, rather than countering spying by the Soviet Union. To underline this change, the new director general of the service, Patrick Walker, has a background in counter-terrorism.

Technical innovation, by itself, won't be enough. A belief had grown up in the 1960s and '70s that the mighty computer -- fed by the mass of data collected by satellites and other forms of electronic eavesdropping -- could solve all intelligence problems. In fact, as the terrorists have come to understand the range of signals intelligence available to the authorities, they have devised measures to counter them. The most obvious and effective countermeasure is simply to maintain a tight cell structure and only rarely communicate by telephone.

Lebanon illustrates that there isn't a technological cure-all. One of the most intensive intelligence-gathering operations in history has been mounted in Lebanon the past several years in an attempt to pin down the location of the hostages held in the country. Satellites and ground stations routinely listen to all telephone calls made by microwave in Beirut, and other surveillance systems pick up many of the calls that go by land line. But the terrorists holding the hostages rarely, if ever, talk on the telephone and nearly all the members are drawn from families who communicate face to face.

There's no substitute, the security services have learned, for intelligence officers who can run agents and informers. So there has been a recruiting campaign among the European intelligence agencies to find spies who can do more than sit behind a desk and interpret computer intercepts and who are prepared to leave the office and get their hands dirty.

There has also finally been recognition that international action needs to be taken to cut the flow of funds to terrorist groups. Two years ago, the U.S. government set up a special task force under the Treasury to investigate the financial resources of terrorist groups. Similar studies have been undertaken in Britain. As a result, treaties will be signed later this year between the United States, Britain, Switzerland, Australia and offshore tax havens such as the Cayman Islands and the Turks and Caicos Islands, which will allow access to personal and corporate bank accounts of any person or company in those countries suspected of being involved in laundering illegal cash. This agreement -- the most comprehensive of its kind between the United States and European countries -- is aimed at cutting the estimated $100 billion a year in cash from drugs and terrorism that is laundered annually through these countries. There is no single tactic that alone has been responsible for the successes against terrorism. But, taken together, all the different initiatives have proved a formidable base from which to counter the bombers and assassins.

What is disturbing is that as one terrorist group is destroyed, another seems to emerge out of the ashes to take its place. In West Germany, for example, when the Baader-Meinhof gang was broken up, the Red Army Faction and the Revolutionary Cells arrived. Both are still around, though increasingly ineffective. They have in turn been replaced by a group known as the Autonomen, described by government sources in Bonn as a kind of "terrorist groupie gang." The group numbers about 200, has no clear ideology (unlike most other such organizations) and appears to attach itself to any cause that happens to be popular at the time.

But even if such groups should emerge today, there is none of the complacency among governments or the police that was evident at the beginning of the 1980s, and this should help contain the problem.

James Adams is the defense correspondent of the London Sunday Times. His latest book, "Secret Armies," will be published in April.