Mayfield had been suspended indefinitely from NASCAR after he allegedly tested positive for methamphetamine in a random drug test at Richmond in May, but on Wednesday he got a temporary injunction from a court in Charlotte that enables him to race again.
The 40-year-old will thus attempt to compete in next weekend's event at Daytona, although he admitted it could be a bit late for him to get his team ready for Thursday, when practice takes place for the Coke Zero 400.
"I'm happy I can go back racing and just glad the justice system works like it does and just thank God," said Mayfield. "It might be a little late for this weekend, but we'll see what happens. I'm able to race, that's the main thing. I think so now. I have to go back and see where we stand on that and where they are.
"The main thing is to be able to go back and be able to do that. The truth came out, and now I can go back and say we're clear of all this. I cleared my name, and now we can go racing again. That means more to me than anything."
Mayfield has denied taking methamphetamine, while saying since the very beginning that a combination of prescribed medicine and over-the-counter drugs resulted in a false positive result in the test.
The driver's defense argued in court that NASCAR did not follow the right procedures in testing Mayfield and had experts contesting the sanctioning body's conclusions about the results of his A sample test, which according to them were inconclusive.
In the court filings, judge Graham Mullen said that the financial harm to done to Mayfield preventing him from racing, substantially outweighs the potential harm to NASCAR.
NASCAR officials stood by their arguments while respecting the court ruling. However, they plan to continue to fight Mayfield's case in the courts.
"We are disappointed, but we respect the judge's ruling," said NASCAR spokesman Ramsey Poston. "This is only a temporary injunction. The legal case continues beyond this point, and we will continue to make our case."
Mayfield started his own team this year and qualified for the season-opener at Daytona back in February.
After that he qualified for four more races, but since being suspended he had been forced to withdraw his team from competition, only attempting one more race with driver JJ Yeley at Charlotte. A number of crew members were also laid off from his team as a consequence.
Burton wants assurances on MayfieldZokora targets Sevilla glory