It happened in the lobby of the Cooper Park Houses around 5:45 p.m. Thursday.
Police say Eric McMichael, 27, went into a lobby in one of the buildings and grabbed the 12-year-old as she walked in, pushed her to the ground in a nearby stairwell and then raped her before running away.
The young girl was taken to a nearby hospital where she is physically doing OK.
McMichael, who lives in a men's shelter, was arrested and charged on Friday.
The victim's mother spoke with Eyewitness News on Friday and had one message.
"I just hope he gets caught, I just hope he just turns himself in, like my daughter is only 12," the victim's mother said.
Her mother said she is horrified this could happen to her happy child.
"She dances, she cares about her friends a lot, good grades in school," her mom said.
The victim said she did not know the man.
----------
* More Brooklyn news
* Send us a news tip
* Download the abc7NY app for breaking news alerts
* Follow us on YouTube