Two men have been arrested following an attempted rape in Brooklyn last month, according to the NYPD.

Police said Ibrahima Diallo and Boubacar Diallo have been charged with attempted rape, assault and sexual abuse in connection with the attack on a 25-year-old woman on May 25 at around 2:15 a.m.

According to police, the victim was walking along the street in the vicinity of Tennis Court and Ocean Avenue near Prospect Park South when she was pushed against a car and sexually assaulted by the two men.

Police said the woman broke free from her assailants, but they followed her to the vestibule of a nearby building and attacked again, pinning her against the door and trying to remove her pants.

When the victim fought back, police said one of the men knocked her to the ground and punched her in the face multiple times.

The suspects then fled the building when a resident entered the vestibule, according to police.

Both men were charged on Wednesday, police said.