As World War II was ending, Nazi Germany began rewriting the history of its European invasions and occupations in an apparent attempt to protect high officials from war crimes charges and to blame the war on France, Britain and the Soviet Union.

Documents recently declassified by the State Department and turned over to the National Archives reveal that the German Foreign Office set up a team of historians in a castle in the village of Ebersdorf in the province of Thuringia to alter dates of events, falsify documents and forge the records of every country the Germans had occupied.

The falsified archives were seized by American troops when they entered Ebersdorf in April, 1945, and commandeered the castle just as the Germans were falsifying a large dossier to justify their occupation policies in Alsace-Lorraine and Czechoslovakia.

"It appears evident that this German Foreign Office research unit was engaged in the study and exploitation of French Foreign Office archives and Dutch, Greek, Norwegian and Polish state papers," said a secret letter written on July 3, 1945, to the State Department by S.J. Kaplan, chief counsel for the Prosecution of Axis Criminality, the legal group gathering evidence for the Nuremberg war crimes trials.

"It also appears evident that the Germans were engaged in a meticulous preparation of a case to justify their foreign policy vis-a-vis the countries concerned," the letter said.

To give credence to their falsified records, the Germans used typewriters taken from the French Foreign Office and the French General Staff, from other foreign offices and from British consulates in Norway and Crete as well as a "complete set of the letterhead paper and envelopes of all the foreign offices of Europe," according to an officer named Abbott who led the American unit that seized the documents.

So important was their revision of history to the Nazis that they made five attempts to recover or destroy the captured documents. Four times, German agents were caught breaking into the castle where the documents were seized by the Americans. The fifth attempt "was an organized descent of armed SS troops from the Thuringia Wald Woods " that was driven back into the forest by American troops occupying Ebersdorf.

When they first entered the castle grounds, the documents show, the American troops found that the ground floor of the castle stables had been transformed into a complete archives laboratory.

"There were archives rooms of all sorts and technical laboratories," the documents said. "Documents were neatly arranged on shelves or piled ceiling high and most of them were in the green cartons of the French Foreign Office. A second look revealed that there were Dutch, Greek, Norwegian and Polish state papers. And this was only the beginning. There were documents cached all over the stable, in the castle and elsewhere in the village.

"We found the documents under straw, in bins, in cases and casks of all sorts, under the rafters, in a secret hideaway in the castle and in stray corners around the village."

Legal officials investigating Nazi war crimes examined the documents and concluded that the Germans had prepared them in part as a defense in the expected war crimes trials.

Said one State Department memo: "I think we may anticipate that the work of this German Foreign Office outfit may be utilized by the German defense in the cases to be prosecuted by Justice Robert H. Jackson," the first prosecutor at Nuremberg.

The Germans had French records dating to the 16th century that were "evidently aimed to prove that they were not the imperialists" in western Europe, the documents say.

In addition, the German archivists were "piecing together a document to prove that their war against Russia was defensive and that the Russian General Staff had long laid plans to invade the Reich on their way through to western Europe," the papers say.

One cited a 1941 Kremlin banquet at which Soviet Premier Josef Stalin proclaimed that "the aims of the Soviet Union could no longer be achieved by a policy of peace and collaboration, that the epoch of peaceful negotiations were now at an end and that the epoch of a dynamic, imperialistic policy for the Soviet Union was about to begin."

When American troops entered Ebersdorf, they found 30 French prisoners-of-war who had heard about the documents and broke into the stables one night to see what was there.

"One glance told them that these were documents of the highest importance and forthwith they organized a 'commando' of their colleagues to keep watch on the documents at all times," the papers say. "More, they sent a scout . . .to inform the Americans that the documents were there and to guide a tank outfit to Ebersdorf . . . ."