Two Southie brothers are accused of “walking away laughing” after urinating on and savagely beating a sleeping homeless man they took for an illegal immigrant, with one claiming they were inspired by Donald Trump.

Scott J. Leader, 38, and Steve M. Leader, 30, of Old Colony Avenue were returning home from a Red Sox game after midnight yesterday, when police say they randomly targeted a 58-year-old homeless man as he lay in his sleeping bag near the JFK/UMass T station.

“Donald Trump was right, all these illegals need to be deported,” Scott Leader said during booking after bragging that he “tuned (up) that illegal immigrant,” according to a police report.

Police Commissioner William B. Evans said it’s people such as the Leader brothers that give Southie a bad name.

“As a resident of Southie … to think that residents would do that to the homeless, especially two adults, I think we should be outraged,” Evans said. “That’s just disgusting … I’m embarrassed as a resident of Southie … when people read about these guys, it gives South Boston a ?bad name.”

Mayor Martin J. Walsh agreed, saying the brothers should “be ashamed of themselves” while pointing out “that’s somebody’s family member that they did that to.”

The “vicious, unprovoked” attack, officials say, left the homeless man hospitalized with a broken nose, serious bruising across his torso and other injuries. Cops responding to the scene say they found him “laying on the ground, shaking, his face was soaking wet.”

After urinating on the man, police say witnesses told them the duo took to beating him with a metal pole and were seen “walking away laughing.”

But the Leader brothers’ alleged rampage didn’t end on Columbia Road, police say. They are also accused of “exposing themselves and urinating in the cell, challenging troopers to come into the cells to fight, banging on the cell door, and making threatening and anti-immigration statements.”

The two pleaded not guilty yesterday at their arraignment in Dorchester District Court to charges including assault and battery with a dangerous weapon and assault and battery for the purpose of intimidation because of national origin. They were ordered held pending a dangerousness hearing next month.

Court records show Scott Leader did time behind bars for a similar attack in Andrew Square in 2011 — targeting a man he decided was a child molester. During that assault, Leader “stomped on the head” of his victim while he lay prone on the pavement because he believed the man had “touched some children in the area of Veterans Park,” records show. Police later determined there had been no complaints filed about the victim.

“These allegations are sickening,” Suffolk District Attorney Daniel F. Conley said in a statement. “Withholding bail was absolutely appropriate given the facts as we understand them. Just as important, however, is that several witnesses stepped up, contacted the police, and gave full statements when they witnessed a vicious, unprovoked crime. They did the right thing here.”