New York State agreed in court papers Tuesday to take steps to ensure that poor people get adequate legal help when they are charged with a crime.

The New York Civil Liberties Union, which filed a lawsuit seven years ago on behalf of poor people in Suffolk and four upstate counties, said it hopes the settlement will be "a springboard" for further reforms.

"Our settlement overhauls public defense in five counties and lays the foundation for statewide reform of New York's broken public defense system," said Donna Lieberman, NYCLU executive director. "The state has . . . shown it will no longer stand by while innocent people lose their families, their homes and their jobs because they're too poor to hire private lawyers."

Gov. Andrew M. Cuomo released a statement saying his administration had inherited the situation, "and I am proud that we have been able to reach a resolution that results in a fairer, more humane justice system."

The NYCLU said public defenders have been known to carry as many as 420 felony cases at a time -- almost triple the caseload recommended by legal experts -- and sometimes don't see their clients before the first court appearance.

In the Suffolk Legal Aid Society, 11 attorneys in the County Court Bureau each carried an average of 255 felony cases in 2010. Lawyers for poor people in Suffolk in 2010 and 2011 used experts or investigators to help defend clients in only 17 out of 10,000 cases examined, the NYCLU said.

The state has now agreed to ensure that every poor person is represented by a lawyer when he or she first appears in court in a criminal case, and will set standards to ensure that defense lawyers have manageable caseloads, Lieberman said.

A 1963 U.S. Supreme Court ruling in Gideon v. Wainwright mandated adequate legal representation for indigent criminal defendants. In 1965, New York created a system placing the burden for such legal defense on counties.

The NYCLU said counties now pay 75 percent to 90 percent of the cost of defending the indigent and "that equation must be flipped," so that the state bears the majority of the cost.

Once the state has fully assumed its responsibilities under the agreement, it will probably be paying "in excess of 50 percent" of the cost of legal defense of the poor, said Gary Stein, a partner with Schulte Roth & Zabel in Manhattan, which helped the NYCLU with the case.

The agreement, which doesn't include Nassau or New York City, is subject to court approval. Once the agreement takes effect, the state has 20 months to make sure that every poor defendant has a lawyer at arraignment, court papers show. The state committed to spending $4 million over the next two fiscal years to improve the system.The NYCLU said the State Office of Indigent Legal Services has estimated it would cost $106 million annually "for caseload relief" in the counties outside New York City.