In a case that could affect tens of thousands of people, a federal judge Friday ordered U.S. immigration officials to accept applications for legal status from immigrants who were abroad during an amnesty period in the 1980s.

The written ruling by U.S. District Judge William Keller came in a class action lawsuit filed by the applicants, who were rejected by the Immigration and Naturalization Service because they had left the country during the May 1987 to May 1988 amnesty period authorized by Congress.

Lawyers for the immigrants, who filed the lawsuit in 1987, hailed Keller's decision, but said they expect the INS to appeal.

"After 10 years of litigation, we are excited that tens of thousands of families may finally emerge from their underground status," said Peter Schey, an attorney with the Center for Human Rights and Constitutional Law, which represented the class of immigrants.

Schey said some 2 million immigrants applied for amnesty during the one-year application period, including those who had traveled briefly outside the United States during that time.

An INS spokesman in Washington, Russ Bergeron, said his agency would have to review the ruling before deciding whether to appeal.

The amnesty applied to immigrants who had maintained a continuous residence in the United States from 1982 to 1987, with brief travel abroad permitted.

When the INS refused to consider applications by those who had left the country during the one-year window, that group of immigrants sued, and the issue has been in litigation for more than a decade.

"Defendants shall accept and adjudicate applications for legalization . . . of plaintiff class members who attempted to file a completed application and application fee with the INS during the [amnesty] period," Keller wrote in his ruling. "Plaintiff class members whose standing claims are denied by the INS and whose applications for legalization the agency will not voluntarily adjudicate shall be advised in writing of the individualized reasons why they lack standing," he said.