A man wanted for questioning in connection to an attempted sex assault on a young girl in Brooklyn has been taken into custody, police said Wednesday.

According to police, an 11-year-old girl was walking to school near Elton Street and Pitkin Avenue just before 8:30 a.m. on Tuesday when a man grabbed her arm and exposed himself to her.

The girl screamed and the man ran westbound on Pitkin Avenue, police said. The girl was not injured in the incident, police said.

Police released surveillance images of the man wanted for questioning in the case. By Tuesday night, just before midnight, police said the man was taken into custody in Brooklyn.

The investigation is ongoing, police said.