A man who was arrested for randomly slashing a woman’s neck earlier this month in Brooklyn told police he attacked her because she is white, police sources said.

Gregory Alfred, 25, told police he set out to find white people to slice back on Mar. 10 because he blamed them and “the system” for preventing him from freely smoking weed, sources said.

The slasher chose to take out his anger on 53-year-old Janina Popko, and cut her across the neck as she was walking near the corner of Beverly and Rugby roads that morning in Ditmas Park, sources said.

“He’s just a sick person,” Popko told The Post on Tuesday. “I’m very lucky to be okay. I am still shaky.”

“I never was racial. I grew up in Poland , they never teach us to be racial,” she added. “I didn’t grow up with this racial thing.”

Alfred discarded a large kitchen knife, black plastic bag and an American flag bandanna after the attack. Cops were able to lift fingerprints from the items, the sources said.

“He had bought paring knives and kitchen knives and said he was going to stab people,” NYPD Chief of Detectives Robert Boyce said at a Tuesday press conference at police headquarters.

“Clearly he is a disturbed man and should never have been out in the street.”

Alfred was taken into custody at his mother’s home in Sayreville, NJ over the weekend, after his mother turned him in after she saw a news report about the slashing.

Alfred, who has more than 20 arrests, is expected to be brought back to New York where he will be charged for the Brooklyn slashing.