Washington state has now banned anyone under 21 from buying a semi-automatic assault rifle, effective Wednesday.

The new measures come as 14,577 were killed from gun-related violence in the US in 2018, according to data from the Gun Violence Archive.

A spokesperson at the Washington Alliance for Gun Responsibility called the new law among the most comprehensive gun-violence prevention measures to pass in the United States.

Assault rifles are the weapon of choice for mass shooters.

Washington on Tuesday joined a handful of other states that ban anyone under 21 from buying a semi-automatic assault rifle.

The measures come into effect after voters passed a sweeping firearms measure in November that has drawn a court challenge from gun-rights advocates.

The ballot initiative seeks to curb gun violence by toughening background checks for people buying assault rifles, increasing the age limit to buy those firearms and requiring the safe storage of all guns.

Only the age-limit portion of the measure goes into effect on Jan. 1; the rest becomes law on July 1.

Kristen Ellingboe, a spokeswoman for the Washington Alliance for Gun Responsibility, said the initiative was one of the most comprehensive gun-violence prevention measures to pass in the United States. It specifically targeted "semi-automatic assault rifles" in response to mass shootings across the country, she said.

According to data provided by the Gun Violence Archive, from January 1, there were 340 mass shootings across the United States in 2018.

"We've seen that assault rifles are the weapon of choice for mass shootings, and when they're used, more people are killed and injured,” Ellingboe said.

Fifty-nine percent of Washington voters approved Initiative 1639 in the Nov. 6 general election.

"We've see time and again that Washington voters want action to prevent gun violence in our state,” Ellingboe said. “They showed that again by supporting 1639 by a wide margin."

Opponents have sued to block it.

"Starting today, young adults between the ages of 18 to 20 will have their rights to purchase semi-automatic rifles stripped away," said Dave Workman, a spokesman for the Bellevue, Washington-based Second Amendment Foundation.

The federal lawsuit says the measure violates the Second and 14th amendments of the Constitution as well as gun sellers' rights under the Commerce Clause.

Plaintiffs in the lawsuit are firearms dealers in Spokane and Vancouver, a 19-year-old competitive shooter, a 19-year-old in the Army Reserves, a 20-year-old recreational shooter, the Second Amendment Foundation and the National Rifle Association.

Washington Attorney General Bob Ferguson said he "looks forward to representing the people of the state of Washington in court against the NRA."

"The gun lobby is trying to thwart the will of nearly 60 percent of Washingtonian voters who supported common sense gun reform in our state," he said in an email.

The full measure, when it goes into effect later this year, will expand the background check process to ensure that vetting for rifle purchases is the same as for buying pistols.

Now, people in Washington who buy long guns are run through the FBI's National Instant Criminal Background Check System, or NICS. Background checks for handgun sales are done by local law enforcement agencies that can access NICS as well as more detailed records that might expose mental health issues or harder-to-find criminal records.

"This will update Washington state law so the requirements to purchase semi-automatic assault rifle will match handguns," Ellingboe said.

In most states, including over the border in Idaho and Oregon, you must be 18 to buy an assault rifle. But Republican-dominant Florida passed a law after a school shooting to increase the age limit to 21.

Nikolas Cruz was 18 when he legally bought the assault rifle he used to kill 17 people at the Marjory Stoneman Douglas High School in Parkland, Florida, last February.

Four other states — Hawaii, Illinois, Vermont and New York — also prohibit anyone under 21 from buying all firearms.

Workman of Second Amendment Foundation says Washington's measure will take away firearms from law-abiding residents who can easily pass multiple background checks. It will impair public safety and embolden criminals while placing restrictions on people who already legally own semi-automatic rifles, Workman said.

According to data from the Gun Violence Archive, 14,577 have died from gun-related violence in the US in 2018, from numbers compiled up to and including New Year's Eve.

The archive calculates some 28,133 others have been injured.

There were 340 mass shootings in America last year, according to information compiled by Business Insider reporter's Melia Robinson, Skye Gould and href="https://www.businessinsider.com/author/samantha-lee" data-e2e-name="byline-author-name">Samantha Lee.

666 children aged under 11 were shot to death or died in gun violence last year.

2,823 kids aged between 12 to 17 were also killed, The Archive reports.

Most US mass shootings involved schools, media, alcohol or religion: