Harper Lee, the aging author of “To Kill a Mockingbird,” has reached a settlement in principle on a lawsuit alleging she was scammed into signing over the copyright to her classic novel by an unscrupulous literary agent who took advantage of her failing hearing and eyesight, a lawyer in the case says.

Lee had filed suit in May against Samuel Pinkus and others — including disgraced journalist Gerald Posner — to reclaim the copyright.

However, dismissal papers were filed in Manhattan federal court today by Lee’s lawyer removing both Posner and Lee Ann Winick, Pinkus’ wife and another defendant, of any liability in the matter except picking up their own legal fees.

Meanwhile, Vincent Carissimi, a lawyer for the defendants, told the Post he expects the entire case to soon be dismissed as a settlement agreement has been reached in principle between Lee and Pinkus and the remaining defendants. He declined to discuss the specifics of any monetary award.

According to court papers, Lee — now 87 and living in an assisted-living facility — was for decades represented by the Mackintosh & Otis literary agency.

But after agency owner Eugene Winick fell ill in 2002, his son-in-law Pinkus allegedly diverted several clients to a new company, “and then engaged in a scheme to dupe Harper Lee, then 80 years old with declining hearing and eyesight,” into signing over her copyright for “no consideration.”

After securing the copyright, Pinkus transferred it to another company incorporated by Posner, who resigned as chief investigative reporter for The Daily Beast in 2010 amid plagiarism allegations.

Lee’s lawyer Gloria C. Phares could not immediately be reached for comment.