Brothers Scott, 38, and Steve Leader, 30, were accused of beating and urinating on a homeless Mexican man in Boston last August.
On Tuesday, both men were sentenced after pleading guilty.
When they were arrested a day after the incident, the men told police: “Donald Trump was right, all these illegals need to be deported,” according to prosecutors.
A witness recording seeing one of the men take a metal pole and strike the victim with it repeatedly, then the two assailants walked away laughing.
The men also threatened police while in custody and believed the attack was justified because the victim was Hispanic and homeless.
“This unprovoked attack on a sleeping man disgusted every prosecutor, victim advocate, and trooper who worked on it,” Suffolk County District Attorney Daniel F. Conley said. “State prison was the only appropriate sentence.”