AUSTIN, Texas (AP) — A federal judge handed Lance Armstrong a quick setback Monday as he went to court to save his seven Tour de France titles and his reputation as one of the greatest cyclists ever.

Armstrong filed a lawsuit aimed at preventing the U.S. Anti-Doping Agency from moving ahead with charges that he used performance-enhancing drugs throughout much of his career.

But within hours, U.S. District Court Judge Sam Sparks in Austin dismissed the 80-page complaint. He said it seemed more intended to whip up public opinion in Armstrong’s favor than focus on legal arguments.

Sparks, however, did not rule on the merits of Armstrong’s claims and will let him refile the lawsuit. Armstrong attorney Tim Herman said he will do that, possibly on Tuesday.

The lawsuit claimed USADA rules violate athletes’ constitutional right to a fair trial, and that the agency doesn’t have jurisdiction in Armstrong’s case. It also accused USADA’s chief executive, Travis Tygart, of waging a personal vendetta against the cancer survivor who won the Tour de France every year from 1999 to 2005.

The judge was not impressed with a filing that dedicated dozens of pages to Armstrong’s career history and long-standing disputes with anti-doping officials.

“This Court is not inclined to indulge Armstrong’s desire for publicity, self-aggrandizement or vilification of Defendants, by sifting through eighty mostly unnecessary pages in search of the few kernels of factual material relevant to his claims,” Sparks wrote.

Herman said he got the message.

“When (Sparks) speaks, I listen,” he said. “It doesn’t change the legal issues involved or any of the relief that we seek.”

The lawsuit was an aggressive, and expected, move as Armstrong seeks to preserve his racing legacy and his place as an advocate for cancer survivors and research. He wants Sparks to bar the USADA from pursuing its case or issuing any sanctions against him.

Armstrong asked the court to issue an injunction by Saturday, the deadline to formally challenge the case against him in USADA’s arbitration process or accept the agency’s sanctions. He could receive a lifetime ban from cycling and be stripped of his Tour de France victories if found guilty.

Armstrong insists he is innocent.

“The process (USADA) seeks to force upon Lance Armstrong is not a fair process and truth is not its goal,” his lawsuit said, calling the USADA process a corrupt “kangaroo court.”

Tygart, who was named as co-defendant, said Armstrong’s lawsuit is “aimed at concealing the truth” and predicted Sparks will rule in the agency’s favor.

USADA, created in 2000 and recognized by Congress as the official anti-doping agency for Olympic sports in the United States, formally charged Armstrong in June with taking performance-enhancing drugs and participating in a vast doping conspiracy on his Tour de France winning teams, some of which were sponsored by the U.S. Postal Service.

The charges came after a two-year federal criminal investigation of Armstrong ended in February with no charges filed. The anti-doping agency, however, says up to 10 former teammates and associates are willing to testify against him and that it has blood samples from 2009-2010 that are “fully consistent” with doping.

Armstrong, who retired in 2011, says he has passed more than 500 drug tests in his career and was never flagged for a positive test.

Armstrong’s lawsuit makes several arguments:

— USADA’s rules and arbitration are designed to find athletes guilty. Athletes are not allowed to subpoena documents or compel witnesses to testify in a hearing. USADA has so far withheld the names of most of the witnesses against Armstrong, saying it is protecting them from potential intimidation.

— The International Cycling Union, cycling’s governing body, which licensed Armstrong to ride professionally, should have jurisdiction over the allegations. Armstrong says allegations of doping by him and his team that were first raised by admitted drug-user Floyd Landis in 2010 should be addressed by UCI.

— USADA may have violated federal law if it coerced witness testimony against him with deals to reduce punishments for riders facing doping charges. Media reports last week said former Armstrong teammates George Hincapie, Levi Leipheimer, David Zabriskie and Christian Vande Velde, who are all riding in this year’s Tour de France, may be witnesses against him.

In a twist, Armstrong is arguing against rules that his personal manager, Bill Stapleton, helped draft when he was a board member of the U.S. Olympic Committee and served as the chairman of the athletes’ advisory council.

Armstrong’s representatives have said those rules were written to deal with cases of athletes facing positive drug tests and lab results, not a case like Armstrong’s where the evidence is weighted toward anecdotal witness testimony.

Legal experts were divided on the strength of Armstrong’s case.

“USADA is a unique agency, far from perfect … but that doesn’t necessarily mean it’s unconstitutional,” said Michael McCann, director of the Sports Law Institute at Vermont Law School. “He makes some good points, but his chances for success are less than likely.”

An Armstrong victory in court, however, could shake USADA to its core, said Michael Straubel, law professor and director of the Sports Law Clinic at Valparaiso University.

Straubel, who has represented athletes with doping cases before USADA, called Armstrong’s lawsuit a “strong case” for greater protection for athletes.

“This is huge. It has tremendous implications for USADA. I really hope USADA thought all this through before it got things started,” Straubel said.

To be successful on his constitutional claims, Armstrong must show that USADA is acting as a government agency. The lawsuit notes that USADA is mostly funded by the federal government and that some of the evidence against him was collected during the federal criminal investigation. On its website, however, USADA calls itself an independent agency.

USADA could ask the court to allow its arbitration process to go ahead, requiring Armstrong to raise his claims after a decision is made. But Armstrong predicts he can’t win in a system stacked against him, and says he needs the court to step in now.

Also charged by USADA are former Armstrong team manager Johan Bruyneel and several team doctors and associates. None of them is included in Armstrong’s lawsuit, but they could be affected by any legal decision because USADA consolidated their charges with Armstrong’s.