WASHINGTON -- Seeking to avert a possible political problem for Republicans, Congress is relaxing two important provisions in a 1996 law that threatened to uproot hundreds of thousands of immigrants living in the United States.

Lawmakers agreed in the waning days of this year's session to exempt thousands of civil war refugees from Central America. As many as 150,000 Nicaraguans would receive the most generous gift handed out by members of Congress: automatic permanent residency.

In another change supported by House Speaker Newt Gingrich, Congress is allowing hundreds of thousands of illegal immigrants who hope to gain permanent visas to stay in the United States instead of having to go home to file their applications.

Taken together with Congress's decision in August to restore benefits to legal immigrants that had been stripped away by last year's welfare law, the softened provisions in the immigration law mark a retreat by House and Senate Republican leaders, who are trying to improve their image with immigrants in states with large populations of them, such as California and Florida.

"All this represents a reversal of some pretty ugly things that happened in last year's immigration bill," said Cecilia Munoz, a deputy vice president for the National Council of La Raza, an immigrant advocacy group here. "It is a strong indication of what we've said all along -- that Congress went much too far last year."

While immigrant advocates generally praised the overall changes to the Illegal Immigration Reform and Immigrant Responsibility Act of 1996, they criticized lawmakers for exempting Cubans, Salvadorans, Nicaraguans, Guatemalans and even some Eastern Europeans from the new deportation rules but not thousands of Haitians who fled after a military coup in 1991.

"My assumption is that immigrants of color have had a very, very hard time," said Democratic Rep. Carrie P. Meek of Florida, whose Miami district has a large Haitian population. "It's discriminatory and it's unfair."

The two immigration provisions are each tucked into large spending bills, one for the District of Columbia and another for the State, Commerce and Justice departments, that the House and Senate are expected to approve by tomorrow.