Despite multiple failed drug tests, a judge rejected a request by prosecutors Thursday to revoke the bond of the mother of a 6-year-old who shot his teacher in Virginia as she awaits sentencing on a federal weapons charge that she used marijuana while possessing a firearm.

U.S. Magistrate Judge Douglas Miller said during a hearing in U.S. District Court that Deja Taylor can remain free on bond despite the failed drug tests because she has made efforts to improve.

Taylor's son used her gun to shoot teacher Abby Zwerner in her Newport News classroom in January. The first-grade teacher was seriously wounded and has endured multiple surgeries.

Taylor pleaded guilty in June to using marijuana while possessing a firearm. Authorities say she also lied about her drug use on a federal background check form when she bought the gun her son brought to school.

A judge had set an Oct. 18 sentencing date and released Taylor on bond under the conditions that she submit to drug tests and receive addiction treatment. But Taylor has twice tested positive for marijuana and once for cocaine, federal prosecutors wrote in a filing with the court this month. She also missed two drug tests and two drug treatment sessions, they said.

VIRGINIA MOM WHOSE 6-YEAR-OLD SON ALLEGEDLY SHOT TEACHER FACING FEDERAL GUN, DRUG CHARGES

"These violations are serious and call into question the defendant’s danger to the community, respect for the law and this Court’s Orders," Assistant U.S. Attorneys Lisa McKeel and Peter Osyf wrote.

James Ellenson, an attorney for Taylor, argued against incarceration, stating Taylor has made "substantial positive developments."

Mother of a 6-year-old who shot his teacher in Virginia

Deja Taylor, the mother of the 6-year-old who shot his teacher in Virginia, faces potential jail time for failing drug tests while awaiting sentencing on federal weapons charges tied to her use of marijuana while possessing a firearm. (Stephen M. Katz/The Virginian-Pilot via AP, File)

She has taken four more drugs tests since Aug. 25, Ellenson said. And while they have been positive for marijuana, "the levels are decreasing and show that Ms. Taylor is abstaining from this drug," Ellenson wrote in a court filing.

After the judge ruled Thursday that Taylor can remain free on bond, attorney Gene Rossi, who also represents Taylor, said she "has many challenges in her life, including her battle with addiction."

"She is struggling, like millions of other citizens in the United States," Rossi said. "We are hoping that the compassion that the judge showed her today will be repeated at her sentencing in October. Miss Taylor has incredible sympathy for the teacher who was shot by her 6-year-old boy."

CLICK HERE TO GET THE FOX NEWS APP

As part of a plea agreement in the case, prosecutors have agreed to ask the judge for a sentence of 18 months to 24 months in prison.

Marijuana is legal in many U.S. states, including Virginia. But it's still a controlled substance under U.S. law, which generally prohibits gun possession by someone who has been convicted of a felony, been committed to a mental institution or illegally uses controlled substances, among other things.

Authorities found marijuana at homes where Taylor was staying during searches that followed the shooting at Richneck Elementary School.

Meanwhile, Taylor still faces sentencing for a state charge of felony child neglect, which was filed after the shooting. That sentencing is scheduled for Oct. 27. In that case, prosecutors agreed to ask for a sentence that falls within state guidelines, expected to be no more than six months. Prosecutors also agreed to drop a misdemeanor charge of reckless storage of a firearm.

Zwerner, the teacher who was shot, is suing the school system for $40 million. She accuses school administrators of gross negligence and of ignoring multiple warnings the day of the shooting that the boy had a gun at school.