BOSTON — Two Boston brothers who claimed to be inspired in part by Donald Trump’s views on immigrants have pleaded guilty to beating a homeless Mexican man.

The Boston Globe reports ( 38-year-old Scott Leader and 30-year-old Steven Leader each pleaded guilty under a plea agreement Monday to felony assault and battery and related crimes.

Scott Leader was sentenced to three years in prison, while Steven Leader was sentenced to at least two years behind bars.

The brothers admitted to urinating on the 58-year-old man as he slept outside of a Dorchester MBTA stop in August, then beating him with a pole, punching and kicking him.

Police say Scott Leader said afterward that Trump was right about deporting “all these illegals.”

The GOP front-runner denounced the attack, tweeting that he would “never condone violence.”