HARTFORD, Conn. (AP) _ A legal settlement that would end a federal court fight over former Gov. John G. Rowland’s decision to lay off unionized state employees about 12 years ago cleared a key legislative committee on Monday.

Some lawmakers voiced concern with the deal, which could potentially cost the state tens of millions of dollars.

But Democratic Rep. William Tong, co-chairman of the Judiciary Committee, said Connecticut is in a difficult position legally and the settlement reached between the state employee unions and Attorney General George Jepsen represents the best of what could be an even worse financial deal for the state.

The 2nd U.S. Circuit Court of Appeals in New York City ruled in 2013 that Rowland’s administration violated the 2,800 workers’ right to freedom of association. The total number of workers potentially affected by the settlement is 37,000 because the court determined their civil rights were also violated.

“There are a couple of significant facts that have put the state on its back foot and that’s what is driving this number,” said Tong, who said the state could potentially face up to $340 million in damages if it doesn’t settle.

Under the agreement, Tong said, the state needs to pay about $40 million in cash. The affected workers would also receive compensation in the form of vacation pay and personal leave that can be used as personal time or redeemed when they leave state employment. The amount of time would be based on a worker’s salary. The total cost of the vacation and personal time has not yet been determined.

Many of the 2,800 laid-off workers were later rehired. But many didn’t get their old jobs back and received less pay.

Sen. John Kissel, the committee’s ranking Senate Republican, reluctantly voted for the agreement.

“I’m not loving this right now, but it seems to me the best that we can do,” he said.

The resolution now awaits action in the Senate and House of Representatives.