The pair of Boston brothers accused of beating a homeless man in August pleaded guilty Monday in Suffolk Superior Court

Scott and Steve Leader, of South Boston, had faced charges after police say they savagely beat and urinated on a 58-year-old homeless man they believed to be an immigrant, repeatedly striking him with a metal pole.

The incident was covered in national media after one brother, Scott, told police he thought the victim deserved to be beaten because he was homeless and Hispanic, and reportedly suggested to police officers he had been inspired by the rhetoric of Donald Trump.

RELATED: Southie brothers accused of beating and urinating on homeless man

“Donald Trump was right, all these illegals need to be deported,” he said, according to police. 

Scott was sentenced to three years in prison, according to a release from the Suffolk District Attorney's Office Monday night. Steve was sentenced to two-and-a-half years in prison.

After their release, they will both be required to serve three years probation, spending one year in a sober house. A judge also ordered them to serve 20 hours of community service and recommended they undergo cultural diversity training.

“This unprovoked attack on a sleeping man disgusted every prosecutor, victim advocate, and trooper who worked on it,” Suffolk DA Dan Conley said in a written statement. “State prison was the only appropriate sentence.”

RELATED: Boston police are rounding up illegal dirt bikes and ATV’s

In court, Assistant DA Nicole Rimar read a statement from the victim, who was not identified in the release.

“I still feel pain all over my body from this incident,” the statement reads. “I don’t think my fingers will ever be the same. I came to this country many years ago and worked hard in the farm fields to provide produce to people here. I actually became a permanent resident of this country years ago, although if I had been undocumented I still would not have deserved to be beaten this way.” 

Trump, the fire-tongued businessman and presumptive GOP presidential nominee was by that point two months into his bid for the White House and had called Mexican immigrants criminals and “rapists” when he launched his campaign.

After the attack outside the JFK/UMass MBTA station in Dorchester, Trump told the Boston Globe “it would be a shame” if the story were true, adding that his supporters are “very passionate.”