Two brothers who claimed to have been inspired by Donald Trump's views on immigration pleaded guilty Monday to beating and urinating on a homeless Mexican immigrant in Boston.

The unprovoked attack in August left the 58-year-old man with a broken nose and bruises to his head and torso, Massachusetts state troopers said.

The brothers, Scott Leader, 38, and Steve Leader, 30, pleaded guilty to felony charges for assault and battery, intimidation, and civil rights violations, the Boston Globe reported.

Scott Leader was sentenced to three years and Steve Leader was sentenced to two years by a judge who called the attack "cowardly and despicable." Scott received a longer sentence because of his extensive criminal history, which includes two other unprovoked attacks on minorities.

The case drew attention after he told police it was OK to attack the man because he was Latino and homeless, the Boston Globe reported.

"Donald Trump was right, all these illegals need to be deported," Scott Leader told police.

Asked about the attack at the time, Trump — who is now the presumptive Republican presidential candidate — pointed out that many of his supporters are "very passionate."

"They love this country and they want this country to be great again," he said.

He later clarified on Twitter that he would "never condone violence."