In what is likely to be one of the last major war crimes hearings in West Germany, a Cologne court today sentenced three aging former Gestapo men to jail sentences ranging up to 12 years for complicity in the murder over 35 years ago of thousands of Jews and communists deported from wartime France.

The longest jail term went to Herbert-Martin Hagen, 66, who had been personal assistant to the SS police chief in France and head of a department in the Paris Gestapo. Kurt Lischka, 70, one-time Gestapo chief in Paris, was sentenced to 10 years in jail, and Ernst Heinrichsohn, 59, who worked in the Gestapo's Jewish affairs department in Paris, received a six-year term.

The trial had been a target for repeated demonstrations by hundreds of French Jews since it began last October. Dozens of Jews, many of them relatives of those who died, were in court to hear the verdict. A number of them wore yellow wartime-style badges saying "Jew from France."

In a two-hour statement after passing sentence, Judge Heinz Fassbender said all three must have realized that death faced many of the 73,000 men, women and children whose deportation between 1942 and 1944 the accused had helped organize. The court heard testimony that about half of those deported had been taken straight to the chambers of Auschwitz and other death camps in Nazi-occupied Poland.

All three defendants denied knowing what was happening to those deported.

After the war, they built successful business careers in modern West Germany. Lischka, now retired, became director of an export-import firm. Hagen has worked as a business manager. Heinrichsohn, a lawyer, was mayor of the small Bavarian town of Burgstadt. His Christian Social Union party announced in Munich today that he had resigned from the post. The defendants sat with heads bowed for most of the judge's final statement.

Among the French Jews present in court was Paris lawyer Serge Klarsfeld, a chief force behind the campaign to bring the three men to justice. His own father had been an Auschwitz victim.

French courts had sentenced each of the defendants in the 1950s -- Heinrichsohn to death and the others to life imprisonment. But West German law prevented them from being extradited to France and for many years France vainly sought a retrial in this country.

Impatient with years of legal delays, Klansfeld and his German-born wife, Beate, attempted to kidnap Lischka in 1974 and carry him back to France. Although the kidnapping attempt was foiled, it gained widespread publicity for the case. The following year Bonn finally ratified an accord with France that cleared the way for a new trial here.

Since the war there have been phases of intense prosecution of Nazi crimes by West German authorities followed by phases of inactivity. It is generally believed, however, that West Germany is approaching the end of such trials, because most potential defendants have either been tried or died and because many witnesses are old, infirm and disappearing.

Due in part to Klarsfeld's success at gathering incriminating documents, the trial went unusually swiftly. West Germany's longest war crimes trial since Nuremberg, involving nine defendants charged with killings at Maidanek death camp in eastern Poland, is now in its fourth year in Duesseldorf.

Coincidentally, the Cologne courthouse in which Lischka and the others face trial is only a few yards from the former Gestapo headquarters where Lischka had his office.