Capping off an unusual week in Donald Trump’s post-presidency, a New York judge on Friday ordered his company and its longtime chief financial officer to stand trial in the fall on tax fraud charges stemming from a long-running criminal investigation into Trump’s business practices. Manhattan District Judge Juan Manuel Merchan scheduled jury selection for Oct. 24 in the case, which involves allegations that the Trump Organization gave CFO Allen Weisselberg more than $1.7 million in off-the-books compensation, including rent, car payments and tuition fees. Lawyers at a hearing Friday suggested the trial could last several months. Merchan denied requests by lawyers for Weiselberg and the Trump Organization to dismiss the case, though he dropped one tax fraud charge against the company citing the statute of limitations. More than a dozen more counts remain. Weiselberg’s lawyers argued that prosecutors in the Democratic-led Manhattan district attorney’s office were punishing him for not naming the former president. Merchan rejected that, saying that the evidence presented to the grand jury “was legally sufficient to support the charges in the indictment” and that those proceedings were conducted properly, “their integrity was not impaired.” If the schedule holds, Weiselberg and the Trump Organization would be on trial during the November midterm elections, where Trump’s Republican party could win control of one or both houses of Congress. At the same time, Trump is laying the groundwork for a possible comeback campaign for president in 2024. The criminal trial is just one of several legal issues playing out in real time in Trump’s orbit. FBI agents searched Trump’s Mar-a-Lago estate in Florida in an unrelated investigation on Monday, and on Thursday, he and the US Department of Justice requested that search warrant documents be made public. Trump sat for a deposition Wednesday as New York Attorney General Letitia James wraps up a parallel political investigation into allegations that Trump’s company misled lenders and tax authorities about property values. Trump invoked his Fifth Amendment protection against self-incrimination more than 400 times. Trump has not been charged in the criminal investigation, but prosecutors noted that he signed some of the checks at the center of the case. Trump, who has decried the New York probes as a “political witch hunt,” said his company’s actions were standard practice in the real estate industry and in no way constituted a crime. James is a Democrat. Weiselberg and the Trump Organization have pleaded not guilty. The most serious charge against Weisselberg, grand theft, carries five to 15 years in prison. Charges of corporate tax fraud are punishable by a fine of twice the amount of unpaid taxes, or $250,000, whichever is greater. Weiselberg, who turns 75 on Monday, is the only Trump official charged in the years-long criminal investigation launched by former Manhattan District Attorney Cyrus Vance Jr., who went to the Supreme Court to secure Trump’s tax records. Vance’s successor, Alvin Bragg, is now overseeing the investigation. Several other Trump officials have been granted immunity to testify before a grand jury in the case. Prosecutors alleged that Weiselberg and the Trump Organization schemed to give off-the-books compensation to senior executives, including Weiselberg, for 15 years. Weiselberg alone was charged with defrauding the federal, state and city governments of more than $900,000 in unpaid taxes and wrongful tax refunds. In the months after Weiselberg’s arrest, the criminal investigation appeared to be moving toward a possible indictment of Trump himself, but the probe has slowed, the grand jury has been disbanded and a top prosecutor has left after Bragg took office in January — if and insists that it is continuing. Although the criminal investigation is separate from the civil investigation of James, which could lead to a lawsuit and fines for Trump and his company, her office has been involved in both investigations. James sent several lawyers to work with Manhattan prosecutors, and it was evidence uncovered in the political investigation that led to criminal charges against Weiselberg. The Morning Update and Afternoon Update newsletters are written by Globe editors, giving you a concise summary of the day’s most important headlines. Sign up today.