A black parolee arrested for raping and bashing a white woman on the roof of his Bronx apartment building allegedly told a witness that she “deserved” the brutal attack because of slavery, according to court papers.

“She was a white girl. She deserved it because us minorities have been through slavery,” Temar Bishop, 23, allegedly said to someone who witnessed the bloodied 20-year-old woman after the assaults, according to a criminal complaint.

“This is what they used to do to us. This is what they did to us during slavery. They used to beat us and whip us.”

Temar Bishop, 23, was arrested by authorities on Friday in Virginia on a slew of charges connected to the early morning June 1 assault, which officials have deemed a hate crime, according to authorities.

The 20-year-old met Bishop — who was on parole after serving just over a year behind bars for robbery — around 5 a.m. and joined him on the rooftop of the public housing building on Alexander Avenue near East 137th Street in Mott Haven, police said.

Bishop allegedly punched her repeatedly before raping her, then continued his assault — kicking and punching her in the head and body until she fell unconscious, cops said.

He then fled, but returned with the unnamed witness — who saw the woman “laying on the roof landing with blood covering her face” — and then allegedly made the remarks about slavery, court documents say.

The woman was treated at an area hospital for several injuries, including a broken nose and broken teeth. She was also “vomiting blood,” the complaint states.

Police sources previously told The Post a Special Victims Division investigator described the attack as “one of the worst he’s ever seen.”

Bishop was charged with two counts of predatory sexual assault, attempted murder, rape, two counts of assault, sexual abuse, assault and a hate crime.

He was arraigned in Bronx court on Saturday, where he was ordered held without bail, a spokeswoman for the Bronx District attorney’s office said.