AUSTIN, Texas (AP) — A federal judge has dismissed the SEC fraud charges against Texas' attorney general as written but is giving regulators two weeks to try again.

Friday's decision is unrelated to the criminal fraud charges that Ken Paxton is fighting in state court. But it is a significant victory for the Republican, who has been under felony indictment for most of his 20 months in office.

Paxton is accused of misleading investors in the tech startup Servergy before becoming Texas' top prosecutor. He was indicted last year and later sued by the U.S. Securities and Exchange Commission, which began investigating Servergy in 2013.

Paxton has pleaded not guilty to the criminal charges and won't stand trial until 2017 at the earliest.