WASHINGTON (AP) — A federal judge in Virginia rejected a bid by President Donald Trump's former campaign chairman, Paul Manafort, to throw out charges in the special counsel's Russia investigation, clearing the way for a much-anticipated trial to start as scheduled next month.

The decision Tuesday by U.S. District Judge T.S. Ellis III was a setback for Manafort in his defense against tax and bank fraud charges brought by special counsel Robert Mueller.

It also deals a blow to a favored talking point of Trump and his legal team as they continue to attack Mueller's investigation. The president had applauded Ellis for his skeptical comments and pointed questioning during a hearing in which he asked Mueller's team whether they brought the case to get Manafort to testify against Trump.

Trump had even read some of Ellis' quotes aloud during a National Rifle Association rally, and as late as early June, Trump lawyer Rudy Giuliani had built up suspense around the ruling, saying the judge was taking weeks to craft an opinion because "there's a real problem" with Mueller's appointment.

But in a 31-page ruling, Ellis rejected the argument of Manafort's attorneys that Mueller had exceeded his authority by bringing charges unrelated to Russian election interference. He said that Mueller's appointment as special counsel was lawful and that he was within his authority to investigate Manafort and file charges against him.

Yet he also expressed wariness about an excessively powerful special counsel, saying, "The appointment of special prosecutors has the potential to disrupt these checks and balances, and to inject a level of toxic partisanship into investigation of matters of public importance.

"This case is a reminder that ultimately, our system of checks and balances and limitations on each branch's powers, although exquisitely designed, ultimately works only if people of virtue, sensitivity, and courage, not affected by the winds of public opinion, choose to work within the confines of the law," he added.

Ellis also largely agreed with the ruling of U.S. District Judge Amy Berman Jackson, who presides in Manafort's criminal case in Washington. Jackson ruled earlier this year that it was "logical and appropriate" for Mueller to investigate Manafort and that prosecutors had received authorization to do so. Jackson had also previously thrown out a civil case Manafort brought challenging Mueller's authority.

Prosecutors had argued that Mueller was within his authority, citing an August 2017 memo from Deputy Attorney General Rod Rosenstein. The memo shows Rosenstein authorized Mueller to investigate Manafort's Ukrainian work and related financial crimes.

Ellis issued the ruling after prosecutors provided him with a full copy of the memo, which also includes the specific activities he is authorized to investigate involving other people beyond Manafort, at least through the middle of last year.

Prosecutors had publicly filed in court a heavily redacted copy of the three-page memo last month, but Ellis had bristled at the redactions and requested a full copy be provided to him under seal.

Ellis' decision allows one of two criminal cases against Manafort to proceed. The Virginia indictment charges him with bank fraud and tax evasion and accuses him of hiding tens of millions of dollars he earned advising pro-Russia politicians in Ukraine from 2006 through 2015. It also accuses him of fraudulently obtaining millions in loans from financial institutions including while he worked for the Trump campaign.

Manafort also faces charges of money-laundering conspiracy, false statements and acting as an unregistered foreign agent for Ukrainian interests. Those were charges brought in federal court in Washington. None of the charges relate to allegations of Russian election interference and possible coordination with Trump associates, the main thrust of Mueller's public appointment order.

She had previously thrown out a civil case Manafort brought challenging Mueller's authority.