Daniel Schertz, 27, apologized to his family before the judge gave him the maximum possible penalty in a plea agreement.
Schertz pleaded guilty to building five pipe bombs and selling them to an undercover informant for 0 in April. The bombs were to be "detonated on a bus carrying Mexican workers to work in Florida," according to his plea agreement.
Schertz also was accused of building two pipe bombs in March to harm Haitians in Florida.
Prosecutor James Brooks said Schertz "was driven by pure hatred. There is no excuse for what he did."
Alcohol, Tobacco, Firearms and Explosives agent Lorin Coppock said evidence included audiotapes and videotapes of Schertz making the devices and discussing how they would be used.
Tests on the bombs showed they would detonate, Coppock said.