Five of eight Iraqi dissidents imprisoned near Los Angeles for the past two years because they were deemed national security threats will be freed and allowed to live and work indefinitely in the United States pending deportation, according to an agreement filed yesterday.

The eight were airlifted out of northern Iraq in 1996 after participating in CIA-financed efforts to topple President Saddam Hussein, but were imprisoned in March 1997 after they arrived in the United States. An immigration judge ordered their deportation in March 1998 on the basis of secret evidence alleging ties to foreign intelligence agencies, including those of Iraq.

The Iraqis' embittering odyssey through the U.S. justice system garnered headlines last year when former director of central intelligence R. James Woolsey signed onto their legal defense team, pro bono, calling the imprisonment of Iraqi anti-government fighters on the basis of secret evidence a "stain" on America's honor.

Under the agreement between their attorneys and the Immigration and Naturalization Service (INS), the five Iraqis will be confined to Lincoln, Neb., where four of their families have been resettled by the government, pending deportation to one of 74 countries where the Iraqis believe they can live safely.

As part of the settlement, the five have agreed to waive all further appeals, admitting that they are in the United States without proper visas. The INS, in turn, agreed to vacate the finding of an immigration judge, since overturned on appeal, that the Iraqis represented threats to national security.

Three other Iraqi opposition members have until July 9 to accept the same arrangement and join the others in Nebraska. Fully litigating their claim for political asylum and, ultimately, U.S. citizenship, could take years, their attorneys said.

Woolsey called the agreement "less than a full victory" but said his clients will be released from jail within two weeks and have admitted to no wrongdoing beyond the visa violation. "The reason they're here without a visa is not that they snuck in -- it's that the INS wouldn't give them one when it brought them here," Woolsey said.

Woolsey said the government's practice of using secret evidence against people it has brought to the United States for political asylum without allowing review by their attorneys "is an abomination -- and that practice has to be changed."

Woolsey called the secret evidence used against his clients "junk" and denied that any of them were Iraqi spies or threats to national security. Much of the secret evidence, released by the government last year after U.S. officials determined it never should have been classified in the first place, consisted of interview notes filed by FBI agents.

Russell A. Bergeron Jr., an INS spokesman, said the agreement freeing the Iraqis "is in no way an admission by the U.S. government that these men were not threats to U.S. national security."

Bergeron said he did not know how long it will take the government to find countries willing to accept the Iraqi opposition members and their families for permanent resettlement.