The Cesar Sayoc case began weeks before the 2018 congressional elections.

Cesar Sayoc, a fanatical supporter of President Donald Trump who last year mailed explosive devices to prominent Democrats and media figures, was sentenced Monday to 20 years in prison after a judge concluded that Sayoc hated his victims but had not meant to kill them.

Prosecutors had sought a life sentence for the 57-year-old former pizza delivery man and strip club worker whose "campaign of terror," they said, coincided with the run up to the 2018 midterm elections. In all, he mailed 16 inoperative pipe bombs targeting, among others, former president Barack Obama, former secretary of state Hillary Clinton and the New York offices of CNN, acting out his paranoid delusions and intense adoration for Trump.

"I am beyond so very sorry for what I did," Sayoc told U.S. District Judge Jed Rakoff. "Now that I am a sober man, I know that I was a sick man. I should have listened to my mother, the love of my life."

Prosecutors and defense lawyers spent much of Monday's hearing wrangling over how dangerous the packages truly were to those who handled them.

"What counts is what he did, and what he intended at the time that he did it," Rakoff said, calling Sayoc's actions "by any measure horrendous."

The judge concluded that Sayoc, "though no firearms expert, was fully capable" of building a functioning bomb if he had wanted to do so. "He hated his victims," the judge added, "but did not wish them dead, at least not by his own hand."

Sayoc's defense lawyer Ian Marcus Amelkin pushed for a 10-year sentence, saying he was using large quantities of steroids when he became obsessed in his support for Trump, consuming conspiracy theories from Fox News and elsewhere that fed his rising paranoia.

"It is impossible to separate the political climate and his mental illness when it comes to the slow boil," Marcus said.

Marcus said that Trump's rhetoric in office contributed to Sayoc's beliefs, noting that the prosecution - working for Trump's Department of Justice - failed to make mention of the president in its prosecuting documents.

Prosecutors downplayed Trump's rhetoric as a cause.

"He's offered a whole slew of excuses blaming politicians, politics and the news media" for his actions, said Assistant U.S. Attorney Jane Kim. She said Sayoc's goal was to "deter and chill political activity."

Rakoff broadly agreed with Kim's assessment, saying that he "wasn't particularly impressed" by the defense team's claims about the influence of Trump or others, calling that a "sideshow."

Rakoff said Sayoc's mental state provided a stark example of "how dysfunctional life, even in our great society, can sometimes be."

Sayoc's sentencing comes just two days after the massacre of nearly two dozen people inside a Walmart in El Paso, Texas, a horrific act of violence allegedly undertaken out of anger toward immigrants. Several Democrats seeking to challenge Trump in the 2020 election have connected the president's rhetoric to Saturday's bloodshed.

The Sayoc case began weeks before the 2018 congressional elections. The suspicious packages prompted a nationwide manhunt, a trail of evidence pointing investigators to the Fort Lauderdale, Florida, area and, eventually, to Sayoc, who lived out of a white van plastered with pro-Trump images. He worked as a DJ or bouncer at strip clubs, and was once charged with threatening the local power company.

After his arrest, Sayoc pleaded guilty in March to 65 counts. Officials said he targeted current and former government officials across the country. In addition to Clinton and Obama, he sent devices to former vice president Joe Biden, Sen. Cory Booker, D-N.J., former CIA director John Brennan, former director of national intelligence James Clapper, actor Robert De Niro, Sen. Kamala Harris, D-Calif., former attorney general Eric Holder, billionaires George Soros and Thomas Steyer, and Rep. Maxine Waters, D-Calif.

At Sayoc's guilty plea, he insisted the devices were "intended to look like pipe bombs," but that he did not mean for them to detonate. Pressed by the judge to explain further, Sayoc added, "I was aware of the risk that they would explode."

Federal officials called the wave of potential explosive devices a "domestic terror attack" and accused Sayoc of endangering numerous lives. Prosecutors said Sayoc began searching for the homes of some people targeted as early as last July 2018 and continued into the fall.

The first package was found Oct. 22, and the investigation and anxiety grew as more devices were identified in the days that followed. CNN's New York offices were evacuated when a package addressed to Brennan was found in the mail room, a situation that played out on live television. Other packages were soon found in Florida, Delaware and California.

Within days, authorities closed in on Sayoc outside an auto supply store in Plantation, Florida, after finding what Christopher Wray, the FBI director, said was a fingerprint on one of the envelopes containing a device. Wray also said there were potential DNA matches connecting Sayoc to some of the devices.

While none of the devices detonated, Wray said they were "not hoax devices." Authorities have described them as "improvised explosive devices," and they said that each of the 16 devices was placed in a padded envelope and filled with explosive material and glass shards meant to function as shrapnel. Outside of each was a photograph of the intended victim with a red "X" marking, officials said.