SACRAMENTO, Calif. — A California man pleaded guilty Friday to plotting to blow up the state Democratic Party’s headquarters in what prosecutors said was the first in a planned series of politically-motivated attacks after the defeat of former President Donald Trump.

Ian Benjamin Rogers, 46, of Napa, pleaded guilty to conspiring to destroy a building by fire or explosives, possessing an explosive device and possessing a machine gun under a plea agreement that could bring him seven to nine years in federal prison.

U.S. prosecutors in San Francisco charged Rogers and Jarrod Copeland with conspiring to attack targets they associated with Democrats after Trump’s defeat in the November 2020 presidential election.

The pair “hoped their attacks would prompt a movement,” prosecutors said when they announced the charges in July.

ROUNDING UP POLITICS: Sign up for USA TODAY’s free OnPolitics newsletter

Copeland, 38, previously pleaded guilty to conspiracy and destruction of records.

“I want to blow up a democrat building bad,” Rogers wrote in one of the messaging apps he used to communicate with Copeland, according to the indictment. In a different message, he said that after Democratic President Joe Biden was inaugurated, “we go to war.”

Their first planned target was the John L. Burton Democratic Headquarters in Sacramento, prosecutors said.

Law enforcement officers who searched Rogers’ home in January 2021 seized nearly 50 firearms, thousands of rounds of ammunition and five pipe bombs, prosecutors said. He was taken into custody then on state charges after the FBI said he sent text messages that agents perceived as threats against the unoccupied Governor’s Mansion and social media companies Facebook and Twitter.