Armed militants who took over a federal building and wildlife refuge in Oregon in a deadly, 41-day standoff with authorities were acquitted of all charges Thursday.

The seven anti-government militia members, led by brothers Ammon and Ryan Bundy, were found not guilty of conspiracy and weapons charges in the standoff at the Malheur National Wildlife Refuge.

An eighth occupier, LaVoy Finicum, was fatally shot by police during the standoff.

After the verdict, court officers had to tackle, tase and hold Ammon defense lawyer Marcus Mumford when he repeatedly yelled that his client must be released immediately. Mumford himself was freed hours later.

The judge said Ammon could not be released because he still faces charges in Nevada stemming from an armed standoff with the feds at dad Cliven Bundy’s ranch two years ago.

An attorney for another defendant was shocked.

“It’s stunning. It’s a stunning victory for the defense,” said Robert Salisbury, attorney for defendant Jeff Banta. “I’m speechless.”

The defendants had maintained that the occupation was an act of civil disobedience inspired by religion and that the weapons they brought onto federal grounds were vital for protection against the government.

“This is a tremendous victory for rural America,” defendant Neil Wampler said outside court.

“It is a well-deserved, overwhelming defeat for a corrupt and predatory federal government.”

Another defendant, who was not in the courtroom due to a medical condition, shed tears of joy when told of the verdict.

“It’s wonderful — the Holy Spirit has been listening to our prayers,” Ken Medenbach told USA Today. “The people have spoken.”

The standoff began on Jan. 2 and lasted nearly six weeks, bringing new attention to the “Sagebrush rebellion,” a long-running dispute over control of federal lands in the West.

Supporters of the militia rejoiced outside the courtroom in Portland, where fellow occupier Brand Thornton held up a ram’s horn in celebration.

The US attorney in Oregon issued a statement defending the decision to bring charges.

“We strongly believe that this case needed to be brought before a court, publicly tried and decided by a jury,” the statement from Billy J. Williams read.

Oregon Gov. Kate Brown said, “The occupation of the Malheur refuge by outsiders did not reflect the Oregon way of respectfully working together to resolve differences.

“I appreciate the due diligence of our federal partners and stand with the communities of Harney County and residents of Burns,” she said, referring to the location of the occupation.

With AP