The judge in Texas overturned the state's ban on carrying a handgun for people under the age of 20.
The Second Amendment of the US Constitution states "the right of the people to keep and bear Arms, shall not be violated", which is what the Firearms Policy Coalition said the Texan law did.
The judge put his ruling on hold so that appeals could be filed.
In June, the Supreme Court expanded Second Amendment rights.
In June, the US Supreme Court overturned a century-old gun-permit law that required people to have a "proper cause." The Second Amendment guaranteed an individual right to carry a weapon in public for self-defense.
The Second Amendment can only be considered a constitutional amendment if it is in line with legislation in the 18th century, according to the judgement.
The US District Court in Fort Worth, Texas threw out the state's ban on 18- to 20-year-olds carrying handguns because there was no tradition of stopping young adults from carrying guns in public.
The Second Amendment protects against this prohibition and the court concluded that it was unconstitutional.
In the founding era, 18- to 20-year-olds were believed to be a part of the militia, according to The Guardian.
"This decision is a significant victory for the rights of young adults in Texas and demonstrates for the rest of the nation that similar bans can't survive constitutional challenges," Wisniewski said in a statement.
In Texas, there is only an age restriction on carrying handguns. The Uvalde shooter, who killed 19 children and two teachers, has been buying long guns for over 60 years.
Shannon Watts, founder of the gun control group Moms Demand, said that after hearing Uvalde survivors demanding common-sense gun safety measures, a judge in Texas just issued a dangerous ruling that would allow teenagers to carry handguns in public.
Texas has made it easier to get a gun in the state.
Governor Greg Abbott signed a law last year that allowed anyone over the age of 21 to carry a handgun without a permit or training.