NEW YORK — A state judge dealt a loss to the Trump Organization on Tuesday, ordering the president's company to turn over records related to a controversial property that is the subject of a civil investigation by the New York attorney general's office.

“We will immediately move to ensure that the Trump Organization complies with the court’s order and submits records related to our investigation,” Attorney General Letitia James, a Democrat, said in a statement after the ruling.

The documents and communications at issue could help investigators answer questions about a conservation easement that was granted several years ago at the Seven Springs estate in suburban New York’s Westchester Country, a move that netted President Trump’s company a $21 million tax deduction. The materials, which Trump’s lawyers had sought to shield, include messages exchanged between an engineer and a land-use lawyer who worked on Trump’s behalf.

The company’s lawyers argued unsuccessfully that those records were covered by attorney-client privilege. The Trump Organization was ordered to provide the documents by Friday, though New York Supreme Court Justice Arthur Engoron said he would consider an extension.

Trump has been accused of inflating the value of assets to get favorable loan rates and undercutting property values for tax benefits. James’s wide-ranging investigation is scrutinizing the Trump Organization’s dealings involving various properties, and whether the company lied to banks and regulators for financial gain.

Representatives for Trump’s business have said it operates aboveboard and follows all applicable laws. They have dismissed James’s investigation as politically motivated.

The case was filed in August after investigators with James’s office said they were having trouble getting the president’s son, Eric Trump, to provide them with documents and testimony. Eric Trump, who assumed oversight of the company when his father took office in 2017, was eventually ordered by the judge to cooperate.

The attorney general’s investigation is one of several legal matters stemming from the president’s business activities and personal conduct that could prove serious once he leaves the White House next month.

Manhattan’s district attorney is conducting a criminal investigation into Trump and the Trump Organization. The president faces defamation lawsuits brought separately by two women who have accused him of sexual assault. His niece, Mary L. Trump, is suing him and his siblings over an inheritance dispute. He’s also being sued by the former tenants of apartments his family once owned, and by people who say they saw little to no profit after joining a multilevel marketing organization touted by Trump and his children.