[What you need to know to start the day: Get New York Today in your inbox.]

Cesar A. Sayoc Jr., the fervent supporter of President Trump who rattled the nation last fall when he sent homemade pipe bombs to former President Barack Obama, Hillary Clinton and other prominent Democrats, was sentenced on Monday to 20 years in prison .

Mr. Sayoc pleaded guilty in March to mailing 16 bombs to people he considered to be Mr. Trump’s enemies. The F.B.I. said the devices were packed with powder from fireworks, fertilizer, a pool chemical and glass fragments that would function as shrapnel, but they would not have worked as designed.

In the end, the flaws in the bombs’ design were critical to a federal judge’s decision to give Mr. Sayoc 20 years in prison rather than the life sentence prosecutors requested. The judge, Jed S. Rakoff of Federal District Court in Manhattan, said he had concluded that Mr. Sayoc, though no firearms expert, was capable of concocting a pipe bomb that could explode and had consciously chosen not to.

“He hated his victims,” the judge said. “He wished them no good, but he was not so lost as to wish them dead, at least not by his own hand.”