(CNN) It was an attack on a homeless man that gained extra media attention when authorities said the accused assailants were heard saying, "Donald Trump was right," as they beat the man with a metal pipe and then urinated on him.

The men were sentenced to state prison Monday after pleading guilty to beating the homeless man in Boston on August 19, 2015, because they believed him to be an illegal immigrant, Suffolk County District Attorney Daniel F. Conley said.

"All these illegals need to be deported," they allegedly said, as they beat the man as he slept near the JFK/UMass MBTA subway station about 12:30 a.m.

The man was treated for a broken nose and serious bruising across his ribs, among other injuries, according to a statement issued at the time from the district attorney's office.

Scott Leader, 38, and his brother, Steve Leader, 30 of South Boston pleaded guilty to indictments charging them with causing bodily injury while committing a civil rights violation, assault and battery for purposes of intimidation causing bodily injury, two counts each of assault and battery, and two counts each of assault and battery with a dangerous weapon.

Read More