Federal and state officials revealed Thursday that they had thwarted a plot to kidnap Michigan Gov. Gretchen Whitmer, unsealing charges against 13 people who they say were involved in various plans to attack law enforcement, overthrow the government and ignite a civil war.

Officials said the conspiracy — which was supposed to come to fruition before the election — seemed to be an ominous indication of how America’s civil unrest has energized violent extremists.

The plotters, according to an FBI affidavit, seemed to be motivated at least in part by their belief that state governments, including Michigan’s, were violating the Constitution. One of those involved complained in June that Whitmer (D) was controlling the opening of gyms — an apparent reference to coronavirus shutdown restrictions — and others were involved in a militia group that had contemplated targeting police in their homes, authorities said. They trained together with firearms and experimented with explosives, authorities said.

But unbeknown to them, the FBI had confidential informants recording many of their meetings and discussions. Before they could attack, law enforcement moved in, arresting some as they pooled money for more explosives, officials said. Six of those were charged federally, and the rest were charged in state court, though officials announced the cases together.

“There has been a disturbing increase in anti-government rhetoric and the re-emergence of groups that embrace extremist ideologies,” Michigan Attorney General Dana Nessel (D) said in a statement announcing the charges. “These groups often seek to recruit new members by seizing on a moment of civil unrest and using it to advance their agenda of self-reliance and armed resistance. This is more than just political disagreement or passionate advocacy, some of these groups’ mission is simply to create chaos and inflict harm upon others.”

The arrests come as federal and local law enforcement are particularly attuned to the possibility of politically motivated violence in the final month before the election. The FBI is investigating potential domestic terrorists around the country and trying to determine whether any of those people are planning acts of violence before or after the election, according to law enforcement officials, speaking on the condition of anonymity to discuss ongoing investigations.

At nationwide protests over racial justice and other matters, demonstrators on opposite sides have periodically clashed — sometimes with deadly results. After a pro-President Trump event in Portland, Ore., in August, for example, a member of the far-right Patriot Prayer group was shot and killed by a man who was a self-described supporter of the far-left antifa movement, authorities have said. The shooting suspect was later killed by police. That same month, a 17-year-old was charged with homicide, accused of fatally shooting two people and seriously wounding another during demonstrations in Kenosha, Wis., over the police shooting of Jacob Blake.

Trump has been publicly critical of Michigan’s leaders because of state-imposed measures to stem the spread of the novel coronavirus, tweeting in April, “LIBERATE MICHIGAN!”

In an afternoon news conference, Whitmer defended the restrictions she imposed — saying she had made “tough choices to keep our state safe” — while taking direct aim at Trump. Just last week, she noted, the president had, during a debate, “refused to condemn white supremacists and hate groups like these two Michigan militia groups” and told one far-right group to “stand back and stand by.”

“When our leaders speak, their words matter. They carry weight,” Whitmer said. “When our leaders meet with, encourage, or fraternize with domestic terrorists, they legitimize their actions, and they are complicit.”

Former vice president Joe Biden, who is running against Trump in the 2020 election, similarly criticized the president.

“Look, the words of a president matter. . . . They can cause a nation to have the market rise or fall, go to war or bring peace,” Biden said. “But they can also breathe oxygen into those who are filled with hate and danger, and I just think it’s got to stop. The president has to realize the words he utters matter.”

On Thursday night, Trump tweeted that Whitmer had “done a terrible job” and chastised her for not offering gratitude for federal law enforcement foiling the plot against her — even though she had thanked the U.S. attorneys involved in the case and praised the FBI agents as “fearless.”

“Rather than say thank you, she calls me a White Supremacist—while Biden and Democrats refuse to condemn Antifa, Anarchists, Looters and Mobs that burn down Democrat run cities,” Trump tweeted. “I do not tolerate ANY extreme violence. Defending ALL Americans, even those who oppose and attack me, is what I will always do as your President! Governor Whitmer—open up your state, open up your schools, and open up your churches!”

Later, on Fox News, Trump again stressed it was “my Justice Department” that arrested those plotting against Whitmer and criticized the governor’s virus restrictions.

Officials announcing the charges hinted at the nation’s toxic political climate — though they did not single out Trump.

“All of us in Michigan can disagree about politics,” said Matthew Schneider, the U.S. attorney for the Eastern District of Michigan. “But those disagreements should never, ever amount to violence.”

Nessel said her office had charged seven people who were linked to the militia group Wolverine Watchmen with providing material support to terrorists and other related offenses. They were planning and training, she said, to attack law enforcement officers and the state Capitol and ignite a civil war.

Michigan Senate Majority Leader Mike Shirkey (R) condemned the suspects on Twitter, writing, “A threat against our Governor is a threat against us all. We condemn those who plotted against her and our government. They are not patriots. There is no honor in their actions. They are criminals and traitors, and they should be prosecuted to the fullest extent of the law.”

April protests against Whitmer’s pandemic restrictions generated outrage and threats of violence, according to monitoring of fringe social media channels by SITE Intelligence Group. One user on 8kun, which is rife with extremist discussion, expressed frustration that the protesters hadn’t killed Whitmer: “You can’t seize power unless you kill those who had power. They did not.”

The FBI said in the affidavit that it became aware that people were discussing an overthrow of the government from social media postings in early 2020, and in June, two of those ultimately charged met with more than a dozen others in Ohio to discuss “creating a society that followed the U.S. Bill of Rights and where they could be self-sufficient.” In that meeting, the FBI alleged, the group discussed both peaceful and violent tactics and ultimately decided it needed to increase its numbers, according to the affidavit.

One in the group, Adam Fox, then contacted a local militia group the FBI already had been monitoring with an informant over concern that it was plotting to kill police officers, according to the affidavit. The group is not named in federal court papers. They and others continued to meet throughout June, including at a Second Amendment rally in Lansing, the affidavit said.

In a June 14 phone call, according to the affidavit, Fox talked of needing “200 men” to storm the Capitol building in Lansing to take hostages, including Whitmer. He said they would try Whitmer for “treason” before the election in November.

The group tried to evade detection — at one point meeting in the basement of a shop that was accessible through a trap door hidden under a rug and turning their cellphones over to Fox, who put them in a box and took them upstairs. But an informant nonetheless wore a wire and recorded them, according to the affidavit.

Court papers paint Fox as the leader of the plot to seize the governor and say he thought the governor would be most vulnerable to abduction when she was entering or leaving either her personal vacation home or the governor’s official summer residence. Fox also allegedly used code words to try to conceal his plans from law enforcement, calling explosives “cupcakes,” and talked about a “baker,” which officials said was a reference to a supposed explosives manufacturer.

Several members of the group participated in firearms training, and in July, they attempted to make and test improvised explosive devices. Those devices ultimately did not detonate as planned, though Andrew B. Birge, the U.S. attorney for the Western District of Michigan, said the group later detonated one.

In addition to talking about storming the state Capitol, the group discussed “shooting up” Whitmer’s vacation home or trying to abduct her as she left there or her official summer residence, the affidavit said. In July, according to the affidavit, Fox told an informant that he had “narrowed down his attack targets to the vacation home and the summer residence” and that he and others twice conducted surveillance at the vacation home.

In September, according to the affidavit, Fox and others drove to the area surrounding the residence and discussed detonating explosives to divert police — even checking the underside of a bridge for spots to place a charge.

Those charged federally were identified as Fox, Barry Croft, Ty Garbin, Kaleb Franks, Daniel Harris and Brandon Caserta.

Caserta identifies himself on social media as an anarchist who opposes all forms of government and said in a YouTube video this year that “every person who works for government is your enemy.” He posted video of himself on YouTube most recently on Sept. 15. In the video, Caserta — wearing a sleeveless T-shirt that says “F--- the government” — repeatedly takes aim with an assault-style rifle at a point off camera, apparently demonstrating the speed with which he can load a magazine.

A LinkedIn page for a Brandon Caserta lists a series of low-wage jobs and says his current employment is as a bicycle mechanic at a bike shop. “I am inquiring about career opportunities in the manufacturing industry,” he writes. It says he graduated from high school in 2006.

A Twitter account that appears to belong to Croft was last used in 2019, when he posted angrily about being kicked off Facebook for violating its community standards. “Fascistbook hard at work protecting People who abuse children,” he wrote on June 8 of that year.

According to the Twitter account, Croft was at least formerly a Trump supporter. “Standing with Trump!” he tweeted on Valentine’s Day in 2017. He also tweeted a criticism of liberals that year, writing what appears to be a mock definition: “Liberal: n. - 1. A spineless, jellyfish like creature, that goes wherever the current pushes them 2. A person with no moral compass.”

In court papers, officials say the Wolverine Watchmen met periodically for “field training” in preparation for “the boogaloo,” a reference to an expected civil war or violent uprising against the government. One of those charged by the state, Joseph Morrison, allegedly founded the Watchmen group and called himself “Boogaloo Bunyan” online. Morrison, 26, lives with Pete Musico, 42, in Munith, Mich., where the pair allegedly hosted the training exercises.

The “boogaloo” ideology has alarmed law enforcement officials in recent months as it attracts online adherents drawn to apocalyptic ideas about mass violence and the end of government.

Officials said the Wolverine Watchmen group trained and discussed possible attacks with Fox and five of his associates charged with federal crimes and that some of the Wolverine Watchmen group — Shawn Fix, 38; William Null, 38; Michael Null, 38; and Eric Molitor, 36 — helped Fox’s group conduct surveillance on the governor’s private vacation home.

A seventh alleged member of the Wolverine Watchmen group, Paul Bellar, 21, was given the role of “sergeant” and helped train the group because of his expertise with firearms, according to court documents.

Nessel said more than 200 state and federal law enforcement officials had executed search and arrest warrants around the state before the charges were unsealed.

Relatives for several of those charged declined to comment; others could not be reached.

Mark Berman, Julie Tate, Craig Timberg and Scott Wilson contributed to this report.

For related video, see ­wapo.st/Michigangov.