EAST BERLIN -- For decades, Markus Wolf was the brilliant spymaster of East Germany. He was so good at it that he inspired the character of the fictional communist spymaster "Karla" in John Le Carre's espionage novels.

But with the historic unraveling of the Iron Curtain, Wolf's flamboyant career seems to have caught up with him, leaving him only three choices: prison, defection or permanent exile in the Soviet Union.

Our U.S. and West German intelligence sources say German police are building a case against Wolf that might charge him, in effect, as an accessory to terrorist assassinations. The 66-year-old Wolf doesn't know how much the West Germans have on him. But he's gotten the hint, and took an extended family vacation to the Soviet Union in February, where he's spent much of his time since.

In 1987, Wolf mysteriously retired after 33 years as the head of East Germany's HVA foreign espionage service, part of the Ministry of State Security. He cited ill health for his departure, though he was healthy. Within two years, the canny Wolf had donned sheep's clothing. He published memoirs in which he criticized hard-liner chief of state Erich Honecker and sided with the reforms of Soviet leader Mikhail Gorbachev.

He became a champion of the East German opposition that eventually ousted Honecker last October and, following a Nov. 4 rally in which Wolf was a speaker, brought down the Berlin Wall five days later.

Wolf had good reason to side with the winners during the struggle; he harbors political ambitions. Privately he reckoned that if Yuri Andropov, a former KGB chief, could become head of the Soviet Union, and George Bush, a former CIA director, could become president of the United States, then there is a place for him as the leader of a unified Germany. But Wolf has overestimated the value of his latter-day reformist credentials, American and West German intelligence officials told us.

For one thing, the officials say his commitment to communism is "very deep." He is the son of a communist doctor who fled Nazi Germany in 1933 to settle in Moscow, where the younger Wolf became fluent in Russian. As a Jew and a communist, Wolf had twice the reason to fear and hate Hitler.

Soviet intelligence officials trained him and made him a spymaster in the postwar East Germany. He sent about 80 percent of his secret service's information and defectors to the KGB. "He was always the KGB's main man in the Ministry for State Security," a West German intelligence official confided. All of this makes Wolf's most viable option exile in the Soviet Union as a hero of that state, whose citizenship he has never relinquished.

For the same reasons, he is unlikely to defect to Western intelligence agencies, even though the extent of his knowledge of East German and Soviet intelligence operations is breathtaking.

A change of heart could be worth his while. One U.S. official said that if Wolf were a sincere defector, brought files with him and allowed round-the-clock debriefings for months, the United States would pay "millions of dollars" for the information.