Rajon Rondo is hoping he won't have to fight a criminal gun charge much longer ... TMZ Sports has learned he's just asked a judge to throw out the count he's facing.
Court documents we obtained show the former NBA star's lawyer filed a motion on Tuesday to dismiss the unlawful carrying of a handgun charge prosecutors hit Rondo with following his arrest late last month.
NBA's Rajon Rondo Arrested, Booked On Weed & Gun Charges
In the documents, Rondo's attorney argues the charge is unconstitutional ... saying the ex-Boston Celtics point guard is protected by the Second Amendment right to bear arms that gave him the right to have the handgun cops say they found on him during a Jan. 28 traffic stop in Indiana.
"The statute under which Rondo is charged fails to be consistent with the Nation's historical tradition of firearm regulation," the docs state.
A judge has not yet made a ruling on the motion ... but there is a hearing on the docket scheduled for late March.
Rondo was first booked on the gun charge following allegations that a loaded, black, 9MM, Sig Sauer P365 was discovered under the cupholder of his car after cops pulled him over for not having plates on the back of his Tesla.
Cops said due to a previous case against Rondo, he was not allowed to have the firearm. In fact, in police documents, one officer wrote, "I asked Rondo Sr. if he was allowed to have a gun and Rondo Sr. said he was not allowed."
In addition to the gun charge, Rondo is also facing one count of possession of marijuana and one count of possession of paraphernalia in the case ... after cops said they found weed, THC gummies and a pipe with marijuana residue in his Tesla during the stop as well.
Rondo -- a four-time All-Star -- last played in the NBA during the 2021-22 season.