CROWN HEIGHTS, Brooklyn — Police have arrested a man who allegedly tried to rape a woman on a No. 4 train early Thursday just after she got on the train, police said.

Daniel Jean-Pierre, of Brooklyn, allegedly tried to kiss the 27-year-old woman as she boarded at Franklin Avenue around 1:15 a.m., official said. She pushed him away, but he grabbed her.

They fought and the woman fell to the floor of the train, police said. She managed to get up, but 37-year-old Jean-Pierre pulled her pants and underwear down and sexually assaulted her with his fingers, police said.

Jean-Pierre then held down both of the woman’s arms as she tried to fight him off, officials said. He later took $47 in cash and a pair of earphones from the woman, then got off the train at Atlantic Avenue and jumped onto the tracks.

According to police, he also attempted to rape a 35-year-old woman just after 11 a.m.

As the woman walked to the Franklin Avenue train station, Jean-Pierre allegedly grabbed her and pulled her into an alley and attempted to rape her. The victim managed to bite his hand and fight him off, police said.

Jean-Pierre smiled for cameras as he was escorted by police out of the precinct, but when asked about his alleged actions, Jean-Pierre questioned "What did I do? I don't even know why I'm here."

Jean-Pierre has been charged with two attempted rapes, two counts of robbery, criminal sex act, two counts of sexual abuse, forcible touching, petit larceny and assault.