SEATTLE (AP) — Washington on Tuesday joined a handful of other states that ban anyone under 21 from buying a semi-automatic assault rifle 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.

"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.

Story continues

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. And you must be 21 to purchase a pistol.

"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.