The U.S. government has agreed to stop deporting most Salvadoran and Guatemalan refugees and allow hundreds of thousands to seek political asylum in this country.

The agreement, announced Thursday, settles a 1985 lawsuit accusing the government of maintaining a double standard in denying political asylum to almost all Guatemalans and Salvadorans who have applied since 1980.The government agreed to halt deportations of all Guatemalans and Salvadorans, except those accused of serious crimes, and allow those held in detention centers to apply for release. It wasn't immediately known how many aliens are incarcerated.

The settlement means as many as 150,000 people denied political asylum since 1980 will have their cases reheard and an estimated 350,000 to 850,000 Guatemalans and Salvadorans who never filed for asylum will have the opportunity to do so without fear of deportation, said lawyers for the aliens.

"This is a victory for the new leadership of the Immigration and Naturalization Service that seems to be determined to end the bias and discrimination of the past," said Lucas Guttentag, a lawyer for the American Civil Liberties Union, one of the organizations that brought the lawsuit.

"We think it is a fair agreement, but we'll make no further statement," said Justice Department spokesman Joe Krovisky.

The settlement is subject to approval at a hearing Jan. 31 before U.S. District Judge Robert Peckham.

Lawyers for the aliens had accused the U.S. government of accepting most applicants from communist nations but rejecting most Salvadorans and Guatemalans because the United States had friendly relations with the two countries.

Government lawyers had contended that Salvadorans and Guatemalans denied asylum were in the United States to pursue economic opportunities and not to escape political persecution.