WASHINGTON - Senators from both parties announced an agreement yesterday on immigration-reform legislation that would bring illegal immigrants and their families "out of the shadows and into the sunshine of American life," as Sen. Edward M. Kennedy put it.

The bill would provide an opportunity "right away" for millions of illegal aliens to correct their status, said Kennedy, D-Mass. It would emphasize family ties, as well as employment skills, in weighing how soon immigrants could become legal residents, he said.

But it would also emphasize improved border security and would call for "very strong sanctions" against employers who knowingly hire illegal immigrants, said Sen. Arlen Specter, R-Pa.

Both senators acknowledged that the proposed bill, which was immediately praised by President Bush, is likely to come under fire both from the political right and the political left - decried either as "amnesty" or as "not humanitarian enough," as Specter said.

To become legislation, the proposed bill would have to be approved by the House, which has had serious differences with the Senate on the issue. The House has tended to emphasize border security more than ways to allow immigrants to become citizens, and any mention of "amnesty" for illegal aliens has been anathema in the House.

Still, Kennedy said that the bill, however imperfect, was the best chance in years to secure America's borders, to help millions of people who have been living in fear and to help eliminate a sad and sordid "underground economy" in American life.

The legislation, as explained by the senators, is "comprehensive" enough to require 380 pages, Specter noted. He said that illegal aliens would have to earn their right to be on the path to citizenship and would have to go to "the end of the line," bureaucratically speaking.

Sen. Harry Reid of Nevada, the Democratic majority leader, yesterday praised the work of the Senate negotiators and said their agreement "can serve as a starting point" for a Senate debate next week.

Bush praised the senators' agreement as a prelude to "an immigration system that is secure, productive, orderly and fair."

The senators said the system they envision would give weight to immigrants' education and to job skills deemed helpful to the economy in deciding whom to admit, using a points system to evaluate those qualifications. Family ties would remain an important factor.

The points system is one element of a comprehensive bill that calls for the biggest changes in immigration law and policy in more than 20 years. The full Senate plans to take up the legislation next week. *