WASHINGTON — Following two mass shootings in Texas in August, some Democrats have ramped up demands for a ban on assault-style weapons, including federal confiscation.

Few advocates on either side of the debate over gun violence and Second Amendment rights see mandatory buybacks becoming law in the foreseeable future.

Only a handful of 2020 Democratic candidates have embraced the idea, most notably Beto O'Rourke. The former El Paso congressman's hometown was the site of one of those rampages, and he declared memorably at a presidential debate in Houston that "Hell yes, we are going to take your AR-15, your AK-47."

Given the legal obstacles and political resistance, many of his rivals for the nomination view the idea as counterproductive, as do many gun control advocates, not to mention Republicans.

How exactly could the government collect the 15 million to 20 million assault-style firearms lawfully owned by Americans?

We tried to find out.

How many weapons would be confiscated?

That’s a tricky question, because there’s no single definition of an assault weapon, and the U.S. government doesn’t track gun ownership with a national registry.

One of the most cited estimates, from the National Shooting Sports Foundation, puts the number of assault-style weapons in the United States at 15 to 20 million. But weapons used by law enforcement account for about half of that.

In 2013, a few months after the Sandy Hook Elementary School massacre in Newtown, Conn., left 26 people dead, all but six of them children, Sen. Ted Cruz accused Democrats of vaguely trying to ban “scary-looking guns.” He noted that minor modifications that had little effect on a gun’s capabilities could determine whether it was legal or not under their proposals.

A current proposal from Rep. David Cicilline, D-R.I., that enjoys broad support from House Democrats would ban any semi-automatic firearm with a detachable magazine and at least one other feature such as a second grip for better aim, a rack to mount additional accessories or different types of muzzles. The bill, which is what O'Rourke would rely on for his buyback plan, also would ban rifles with a fixed magazine that holds more than 10 rounds, and more than 200 specific models of weapons.

Congress used a slightly narrower definition in the 1994 assault weapons ban, which expired after a decade.

Semi-automatic weapons with a fixed magazine that held more than 10 rounds remained legal, for instance. The 1994 ban applied to certain specified guns, and guns with a detachable magazine and at least two other features such as a second grip, a rack to mount additional accessories or different types of barrels and suppressors.

How much would it cost if every gun owner complied fully with a mandatory buyback?

That depends.

O’Rourke hasn’t said exactly how much owners should be compensated. He would establish a commission, using market values as a benchmark, and would fund the program through a tax on gun manufacturers.

Local and statewide voluntary buybacks around the country have used $200 gift cards for handguns, rifles and other firearms. Rep. Eric Swalwell, D-Calif., who recently dropped out of the 2020 presidential race, proposed looking at the previous year’s market price for each weapon, and paying the owner the median value.

The average asking price for assault weapons is $800, according to The Trace.

If there are 10 million civilian-owned assault weapons, and they’re all turned in under that approach, the cost to U.S. taxpayers would be $8 billion.

How would confiscation work?

Congress would have to ban ownership of particular weapons, and that law would have to survive a certain veto from President Donald Trump.

Under Swalwell’s bill, the only pending legislation of this sort, the Bureau of Alcohol, Tobacco, Firearms and Explosives would have three months to publish prices the government will pay, and a year to execute the program.

Confiscated weapons and accessories would be destroyed, unless they are evidence in an ongoing criminal investigation. And if owners don’t fully comply? Up to five years in prison could await anyone caught with an illegal assault weapon.

In Texas, Houston-area state Rep. Briscoe Cain warned O'Rourke with a veiled threat of violence that he would refuse any effort to seize his AR-15. O'Rourke says he believes that most law-abiding Americans would comply with federal law, and fines — unspecified — await those who don't.

Has confiscation ever been tried in the United States?

A mandatory buyback has never been attempted.

Even when bans have been enacted, like the 1994 assault weapons ban, existing guns were grandfathered. Only importation and new manufacturing were halted.

Voluntary buybacks have taken place for decades, though never at the federal level.

A Baltimore program in 1974 is believed to be the first in the country. Police collected 13,500 guns at the cost of $660,000. Voluntary gun buybacks have taken place since then in California, Washington state, Massachusetts and elsewhere.

Such programs rarely get the most dangerous firearms off the streets, said Michael Scott, the director of the Center for Problem-Oriented Policing. And because the programs are localized, he noted, weapons can easily flow back into cities from surrounding areas.

Have other countries confiscated guns?

Australia implemented a mandatory buyback in 1996 after banning semi-automatic rifles and pump shotguns and rifles following the 1996 Port Arthur Massacre, which left 35 people dead.

The country’s constitution delegates gun control to Australian states. Just 12 days after the Port Arthur massacre, the states all agreed to uniform standards for an assault weapon ban and buyback, called the National Firearms Agreement.

Gun owners were paid market value, and the national government funded the buyback through a 2% tax.

New Zealand is the latest country to try a mandatory gun buyback, following attacks by a white supremacist last March at two mosques in Christchurch that left 51 people dead.

Less than a month later, parliament voted 119-1 to ban semiautomatic weapons and implement the buyback.

New Zealand set aside about $129 million and is paying 25% to 95% of market value, depending on the condition of each gun turned in. The six-month program runs through Dec. 20.

Neither country guarantees its citizens the right to own a firearm. In both countries, gun ownership is treated as a privilege rather than a constitutionally protected right as in the United States.

Neither tracked most gun sales before the bans went into effect, making it difficult to know how many civilian-owned firearms were in circulation.

Australia collected more than 650,000 guns, or an estimated 20% of the firearms privately owned by just over 18 million Australians at the time, according to a Harvard study. The country has seen a steep decline in homicides and suicides involving guns, and in mass shootings, since the ban and buyback.

According to Philip Alpers, founder of a group that studies gun violence worldwide and an adjunct faculty member at the University of Sydney, the 650,000 firearms turned in represented more than 80% of the newly-banned assault weapons.

And most Australians were happy to comply following the “shock” of the Port Arthur massacre, he said.

And it is almost impossible to get a banned firearm in Australia now. Being an island nation makes smuggling harder and amplifies the effect of a mandatory buyback.

“You would have to have serious criminal, black market connections to get your hands on one of those weapons,” Alpers said.

In New Zealand, a country of 4.8 million people, residents owned more than 100,000 assault weapons before the ban, according to GunPolicy.org. With two months left in the buyback program, more than 15,000 banned firearms and 64,000 parts have been collected, costing more than $20 million.

With no national gun registry, it’s difficult to gauge the level of compliance.

The Mongrel Mob and other gangs said after the massacre that they would refuse to turn in their weapons, according to New Zealand news outlet Stuff.

On the other hand, hundreds of assault weapons were voluntarily surrendered to the government before the ban even passed.

Could a mandatory buyback happen in America?

The legality of a mandatory buyback in the U.S. is arguable.

Gun rights advocates and some legal scholars say it would violate the Second Amendment and another constitutional provision, in the Fifth Amendment, that protects private property from seizure without due process and compensation.

Others, O'Rourke included, argue that the right to bear arms isn’t unlimited. Civilians aren’t allowed to own nuclear weapons, for instance.

On the political side, a mandatory assault weapon buyback has substantial but mixed support.

A recent Washington Post/ABC News poll found 52% of Americans in favor and 44% opposed, with a stark partisan divide: 74% of Democrats support confiscation, versus 33% of Republicans.

In the Democratic-controlled House, just three lawmakers have signed onto Swalwell’s bill creating a mandatory buyback program.

“America doesn’t have a prayer of doing what Australia did,” Alpers said. “What happened in Australia amounts to confiscation of private property under the threat of jail time. That’s not the American way."