A Connecticut company has agreed to pay a record $415 million to 3,000 steelworkers who said the company had secretly plotted to cheat them out of pensions by laying them off before they had 20 years of service.

The settlement between Continental Can Co. and the United Steelworkers of America ends an eight-year-old federal lawsuit brought by the union, a union source said yesterday.

Under the agreement, scheduled to be announced in Washington today, both sides were operating under a gag order not to discuss the case publicly before midnight, the source said.

The $415 million settlement is the largest payout ever made to workers by a company for alleged violations under the Employee Retirement Income Security Act of 1974, the federal law governing pensions and benefits.

The case stemmed from a 1983 lawsuit filed by the United Steelworkers in which the union charged that the company had secretly plotted to lay off workers and shut down plants to avoid having to pay lucrative pensions to workers who had 20 years of service or more.

During the 1970s, the union had negotiated contracts with the company that gave workers hefty benefit packages, the most expensive of which took effect when workers had 20 years of service.

The union contended that at the same time the company was negotiating those contracts, it was plotting to shift work around and close plantsso it could lay off workers just before they hit the 20-year mark. In all, the company closed 33 plants.

The union made use of a provision in the federal pensions law that prevents companies from discriminating against workers to keep them from gaining a pension.

Lawyers for Continental Can were not available for comment yesterday, said a woman who answered the phone in the company's Norwalk, Conn., offices.