A U.S. immigration judge has refused to order the deportation of Karlis Detlavs, the 68-year-old Baltimore man who was accused of committing war crimes against Jews while serving in the Nazi-backed Latvian Legion during World War II.

Judge Emil M. Bobek ruled that none of the government's witnesses satisfactorily identified Detlavs, a Latvian native, as being the same man they saw beat and participate in the execution of Jewish residents of Latvia during the war.

In addition, Judge Bobek ruled that Detlavs cannot be deported for having lied about his membership in the Latvian Legion in his application for a U.S. visa in 1950 because "the misrepresentation" did not warrant deportation.

Detlavs conceded he lied about have served in the legion: admitting legion membership at the time would have prevented him from getting a visa to enter this country. But he denied all other charges against him.

Detlavs, who lost a leg to cancer in 1973 and has recently been hospitalized for heart trouble and gallstones, was happy but cautious yesterday when informed of the judge's decision by a reporter.

"I very lucky -- if this true," he said as he looked up from a large jigsaw puzzle he was piecing together in his tidy house in Baltimore."I will believe (it) when lawyer tells me so."

A Justice Department spokesman said yesterday it has not yet been decided to appeal the judge's ruling.

Crucial to this issue is the question of identity," wrote Judge Bobek in his undated opinion, a copy of which was obtained yesterday by The Washington Post. "Was this Respondent [Detlavs] the individual who committed the atrocities which the witnesses saw? . . . At no time did the witnesses directly identify the Respondent in the courtroom."

Instead, Bobek wrote, the witnesses relied on a photograph of Detlavs taken from his visa application in 1950, which the judge said distinctly showed one eye -- blinded in 1943 -- askew. None the less, Bobek noted, all the witnesses claimed that the picture was exactly like the man they saw in 1941 assaulting Jews in Riga and elsewhere.

"Significantly to this Court," wrote Bobek, "no mention was made of the Respondent's eyes."

Detlavs, who retired in 1973 after 23 years as a factory worker for General Electric in Baltimore, was plucked from working class obscurity along with two other elderly East European immigrants in 1976 when the Immigration and Naturalization Service moved to deport them on the basis that all were alleged to have participated in or committed war crimes during the second world war.

Detlavs was accused of having helped select a group of Jews for execution in Latvia in 1941, "of the shooting of Jewish people," and of assaulting three Jews during the years 1941 to 1743. The INS also accused Detlavs of gaining entry to the United States by concealing his membership in the Latvian Legion from 1941 to 1944.

"We came to America and were happy," Detlavs subsequently testified. "I got a job for 75 cents an hour. Worked 23 years, educated my daughter, bought a house, paid for it. I have no debts. I am very happy man. I am very sorry I lied."

But he denied all allegations of war crimes. His witnesses included his sister, who testified that he was not in Riga at the time that some of his crimes there were supposed to have been committed.

Government witnesses testified they saw Detlavs beating Jews in Latvia on four separate occasions after German forces overran the tiny country -- since taken over by the Soviet Union -- in 1941.

"I had gone out to look for food," one witness testified at one point during the hearings, which were stretched out over two years because of the death of the original hearing judge. "I heard a terrible scream. I ran towards the fence. I looked between the boards of the fence to see where the screaming was coming from. I saw an old Jew who had already been beaten up. He wouldn't stop screaming and I saw Detlavs beating him on the face and chest."

The government has the right to appeal an immigration judge's ruling to the Immigration Board of Appeals. Yesterday, however, a Justice Department spokesman said, "I don't know whether there will be an appeal. The (judge's) decision is being reviewed now. A decision would be made sometime in the future."

He said the department would have no comment on the substance of the judge's ruling.