(Adds judge's ruling in separate Wednesday hearing)
NEW YORK, June 8 (Reuters) - Donald Trump and two of his adult children, Donald Trump Jr. and Ivanka Trump, have agreed to testify starting July 15 in a New York state civil investigation into the former U.S. president's business practices.
The Trumps' testimony could last through the following week, according to an agreement with state Attorney General Letitia James made public on Wednesday. James is investigating whether the Trump Organization misled lenders and tax authorities.
The deal for the Trumps to testify came more than six months after James first issued subpoenas for their testimony, which the Trumps fought bitterly in court. Last month, an intermediate state appeals court denied the Trumps' bid to avoid testimony in James' probe.
Trump, 75, and his son and daughter, both in their 40s, had argued that testifying in the civil probe would violate their constitutional rights because their words could be used in a related criminal investigation led by Manhattan District Attorney Alvin Bragg.
Separately, a New York state judge ruled in a virtual hearing on Wednesday that Trump must send James affidavits from several Trump Organization executives about their policies for retaining or destroying records.
But the judge, Arthur Engoron, said he would not yet fully purge a contempt order he issued against Trump in April for failing to comply with a subpoena from the state attorney general. Trump had said he had no documents that were relevant to the probe, a claim Engoron said he found "surprising."
Engoron rejected a suggestion by Trump lawyer Alina Habba that he might have ruled differently had someone other than Trump been involved. "I try to take myself out of the equation," the judge said.
The former president last month paid a $110,000 fine - one of the conditions needed to lift the contempt order - a sum being held in escrow pending Trump's appeal of Engoron's order.
James says her more-than-three-year investigation has found evidence that the Trump Organization - which manages hotels, golf courses and other real estate throughout the world - overstated asset values to obtain benefits such as favorable loans and understated the values to get tax breaks.
Trump, a Republican, has denied wrongdoing, and called the investigation politically motivated. James is a Democrat.
The Trumps have until June 13 to ask New York state's highest court, the Court of Appeals, to further delay any testimony in James' probe. The testimony would be postponed if that court issued a stay. (Reporting by Karen Freifeld and Luc Cohen in New York; Editing by Jonathan Oatis and Howard Goller)