In a surprise ruling Tuesday afternoon in Charlotte, N.C., U.S. District Court Judge Graham Mullen dismissed all claims by owner/driver Jeremy Mayfield in his lawsuit against NASCAR. Mayfield had sued the sanctioning body after he was indefinitely suspended last May. NASCAR said Mayfield had tested positive for methamphetamine.

NASCAR filed a motion last November for the judge to rule on the case based on the pleadings already submitted, and late on Tuesday Judge Mullen issued a ruling declaring that Mayfield had waived his right to sue by signing three specific agreements with NASCAR. These included the 2009 driver and owner agreement, a competition application for drivers, and a competition application for owners. Those agreements require competitors to abide by the NASCAR substance abuse policy, which forbids any "claim or cause of action of any kind against NASCAR or any director" for publication of a competitor's results.

"Plaintiffs [Mayfield] agreed to release Defendants from all claims arising under a negligence theory or otherwise; Plaintiffs thereby waived their right to pursue their claims for defamation, unfair and deceptive trade practices, breach of contract, and negligence," Mullen wrote in his order. "Plaintiffs also failed to allege facts to support each of their claims. Plaintiffs claims are hereby dismissed."

Mullen's ruling can be appealed to the U.S. Court of Appeals, but Mayfield and his attorney had no immediate comment. NASCAR issued a statement expressing its satisfaction with the judge's ruling.

"The U.S. District Court's ruling is a powerful acknowledgment and affirmation of NASCAR's rulebook and its ability to police the sport," the statement read. "NASCAR has been very clear with its competitors as to its policies and what is expected of them. NASCAR's comprehensive substance abuse policy, which is among the best and toughest in all of sports, serves the safety of our competitors and fans."

Mayfield's suit had alleged breach of contract, discrimination and defamation on the part of NASCAR, and won an injunction to participate in NASCAR races last July. However, he never entered a race after winning the injunction, which was subsequently set aside by the court at Mayfield's own request, in order to obtain a speedier trial.

Meanwhile, NASCAR's own countersuit against Mayfield, in which it accused him of willfully violating its substance abuse policy, breaching his contract and of defrauding NASCAR and its competitors of earnings, continues to go forward.